'Publish message onto an exchange using a routing key.
Publish a message onto an exchange specified by name using a
routing key specified by routing_key. Prepares the message in the
following ways before sending:
- encodes the body using :meth:`encode_body`
- wraps the body as a buffer object, so that
:class:`qpid.messaging.endpoints.Sender` uses a content type
that can support arbitrarily large messages.
- sets delivery_tag to a random uuid.UUID
- sets the exchange and routing_key info as delivery_info
Internally uses :meth:`_put` to send the message synchronously. This
message is typically called by
:class:`kombu.messaging.Producer._publish` as the final step in
message publication.
:param message: A dict containing key value pairs with the message
data. A valid message dict can be generated using the
:meth:`prepare_message` method.
:type message: dict
:param exchange: The name of the exchange to submit this message
onto.
:type exchange: str
:param routing_key: The routing key to be used as the message is
submitted onto the exchange.
:type routing_key: str'

def basic_publish(self, message, exchange, routing_key, **kwargs):

    (message[u'body'], body_encoding) = self.encode_body(message[u'body'], self.body_encoding)
    message[u'body'] = buffer(message[u'body'])
    props = message[u'properties']
    props.update(body_encoding=body_encoding, delivery_tag=uuid.uuid4())
    props[u'delivery_info'].update(exchange=exchange, routing_key=routing_key)
    self._put(routing_key, message, exchange, **kwargs)
