code: def _validate_publish_parameters(body, exchange, immediate, mandatory,
                                       properties, routing_key):
          
          if not compatibility.is_string(body):
              raise AMQPInvalidArgument('body should be a string')
          elif not compatibility.is_string(routing_key):
              raise AMQPInvalidArgument('routing_key should be a string')
          elif not compatibility.is_string(exchange):
              raise AMQPInvalidArgument('exchange should be a string')
          elif properties is not None and not isinstance(properties, dict):
              raise AMQPInvalidArgument('properties should be a dict or None')
          elif not isinstance(mandatory, bool):
              raise AMQPInvalidArgument('mandatory should be a boolean')
          elif not isinstance(immediate, bool):
              raise AMQPInvalidArgument('immediate should be a boolean')
docs: Validate Publish Parameters.
  
          :param bytes|str|unicode body: Message payload
          :param str routing_key: Message routing key
          :param str exchange: The exchange to publish the message to
          :param dict properties: Message properties
          :param bool mandatory: Requires the message is published
          :param bool immediate: Request immediate delivery
  
          :raises AMQPInvalidArgument: Invalid Parameters
  
          :return: