Beispiel #1
0
 def publish_to(self, exchange, routing_key):
     """publish to the exchange with the given routing key"""
     self.exchange = exchange
     self.routing_key = routing_key
     self.channel = yield open_channel(self.amq_client, PUBLISHER_CHANNEL_ID)
     log.msg("Ready to publish to exchange '%s' with routing key '%s'" % (
         self.exchange, self.routing_key), logLevel=logging.DEBUG)
Beispiel #2
0
 def join_queue(self, exchange_name, exchange_type, queue_name, routing_key):
     """
     join the named queue with the given routing key attached
     to the given exchange
     """
     self.queue_name = queue_name
     self.routing_key = routing_key
     self.channel = yield open_channel(self.amq_client, CONSUMER_CHANNEL_ID)
     self.queue = yield join_queue(self.amq_client, self.channel, exchange_name,
                                 exchange_type, queue_name, routing_key)
     log.msg("Got a queue: %s" % self.queue, logLevel=logging.DEBUG)
     defer.returnValue(self)