Exemple #1
0
 def __init__(self,
              conf,
              channel,
              topic,
              callback,
              tag,
              name=None,
              exchange_name=None,
              **kwargs):
     options = {
         'durable': conf.rabbit_durable_queues,
         'queue_arguments': _get_queue_arguments(conf),
         'auto_delete': False,
         'exclusive': False
     }
     options.update(kwargs)
     #TODO
     exchange_name = exchange_name or rpc_amqp.get_control_exchange(conf)
     exchange = kombu.entity.Exchange(name=exchange_name,
                                      type='topic',
                                      durable=options['durable'],
                                      auto_delete=options['auto_delete'])
     super(TopicConsumer, self).__init__(channel,
                                         callback,
                                         tag,
                                         name=name or topic,
                                         exchange=exchange,
                                         routing_key=topic,
                                         **options)
Exemple #2
0
 def __init__(self, conf, channel, topic, **kwargs):
     options = {
         'durable': conf.rabbit_durable_queues,
         'auto_delete': False,
         'exclusive': False
     }
     options.update(kwargs)
     exchange_name = rpc_amqp.get_control_exchange(conf)
     super(TopicPublisher, self).__init__(channel,
                                          exchange_name,
                                          topic,
                                          type='topic',
                                          **options)
Exemple #3
0
 def __init__(self, conf, channel, topic, callback, tag, name=None, exchange_name=None, **kwargs):
     options = {
         "durable": conf.rabbit_durable_queues,
         "queue_arguments": _get_queue_arguments(conf),
         "auto_delete": False,
         "exclusive": False,
     }
     options.update(kwargs)
     # TODO
     exchange_name = exchange_name or rpc_amqp.get_control_exchange(conf)
     exchange = kombu.entity.Exchange(
         name=exchange_name, type="topic", durable=options["durable"], auto_delete=options["auto_delete"]
     )
     super(TopicConsumer, self).__init__(
         channel, callback, tag, name=name or topic, exchange=exchange, routing_key=topic, **options
     )
Exemple #4
0
 def __init__(self, conf, channel, topic, **kwargs):
     options = {"durable": conf.rabbit_durable_queues, "auto_delete": False, "exclusive": False}
     options.update(kwargs)
     exchange_name = rpc_amqp.get_control_exchange(conf)
     super(TopicPublisher, self).__init__(channel, exchange_name, topic, type="topic", **options)