Exemplo n.º 1
0
 def commit(self, transaction):
     with Connection(self.url) as conn:
         while self.messages:
             uid, message = self.messages.popitem()
             payload = message.dump()
             queue = getUtility(IQueue, message.type)
             message.publish(payload, conn, queue, message.type)
             log.debug('Sending Message to queue %s' % queue)
Exemplo n.º 2
0
 def commit(self, transaction):
     with Connection(self.url) as conn:
         while self.messages:
             uid, message = self.messages.popitem()
             payload = message.dump()
             queue = getUtility(IQueue, message.type)
             message.publish(payload, conn, queue, message.type)
             log.debug('Sending Message to queue %s' %queue)
Exemplo n.º 3
0
 def send(self, message):
     with transaction.manager as tm:
         log.debug('Sending Message for routing_key %s' % (message.type))
         with MQTransaction(self.url, self.queues, tm) as message_manager:
             message_manager.createMessage(message)