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)
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)
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)