'Publish to the channel with the given exchange, routing key and body.
Returns a boolean value indicating the success of the operation.
This is the legacy BlockingChannel method for publishing. See also
`BlockingChannel.publish` that provides more information about failures.
For more information on basic_publish and what the parameters do, see:
http://www.rabbitmq.com/amqp-0-9-1-reference.html#basic.publish
NOTE: mandatory and immediate may be enabled even without delivery
confirmation, but in the absence of delivery confirmation the
synchronous implementation has no way to know how long to wait for
the Basic.Return or lack thereof.
:param exchange: The exchange to publish to
:type exchange: str or unicode
:param routing_key: The routing key to bind on
:type routing_key: str or unicode
:param body: The message body; empty string if no body
:type body: str or unicode
:param pika.spec.BasicProperties properties: message properties
:param bool mandatory: The mandatory flag
:param bool immediate: The immediate flag
:returns: True if delivery confirmation is not enabled (NEW in pika
0.10.0); otherwise returns False if the message could not be
deliveved (Basic.nack and/or Basic.Return) and True if the message
was delivered (Basic.ack and no Basic.Return)'

def basic_publish(self, exchange, routing_key, body, properties=None, mandatory=False, immediate=False):

    try:
        self.publish(exchange, routing_key, body, properties, mandatory, immediate)
    except (exceptions.NackError, exceptions.UnroutableError):
        return False
    else:
        return True
