def pushtomq(channel, message): env = tools.fetchenv() channel.basic_publish(exchange='', routing_key=str(env['CRAWLER_AMQP_ROUTING_KEY']), body=message, properties=pika.BasicProperties(delivery_mode = 2))
def consumemq(channel, callback): env = tools.fetchenv() channel.basic_consume(callback, queue=str(env['CRAWLER_AMQP_ROUTING_KEY'])) channel.start_consuming()