@@ -0,0 +1,1428 @@
+from app import config%0Afrom pika import PlainCredentials, BlockingConnection, ConnectionParameters, BasicProperties, exceptions%0Aimport threading%0Aimport syslog%0A%0A%0Aclass SendToRabbitMQ(object):%0A    def __init__(self, body, exchange, routing):%0A        %22%22%22Send scan message to rabbitMQ%22%22%22%0A%0A        self.body = body%0A        self.exchange = exchange%0A        self.routing = routing%0A%0A        t = threading.Thread(target=self.run)%0A        t.start()%0A%0A    def run(self):%0A%0A        try:%0A            credentials = PlainCredentials(config.mq_user, config.mq_password)%0A            connection = BlockingConnection(ConnectionParameters(host=config.mq_host,%0A                                                                 port=config.mq_port,%0A                                                                 ssl=config.mq_ssl,%0A                                                                 credentials=credentials))%0A%0A            channel = connection.channel()%0A%0A            channel.basic_publish(exchange=self.exchange,%0A                                  routing_key=self.routing,%0A                                  body=self.body,%0A                                  properties=BasicProperties(%0A                                      delivery_mode=2%0A                                  ))%0A            connection.close()%0A%0A        except exceptions.ChannelClosed as che:%0A            syslog.syslog(syslog.LOG_INFO, 'SendToRabbitMQ error: %25s' %25 str(che))%0A%0A

add RabbitMQ support!