How to use the kombu.entity.Queue function in kombu

To help you get started, we’ve selected a few kombu examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github openstack / trove / trove / common / rpc / __init__.py View on Github external
def delete_queue(context, topic):
    if CONF.rpc_backend == "trove.openstack.common.rpc.impl_kombu":
        connection = openstack_rpc.create_connection()
        channel = connection.channel
        durable = connection.conf.amqp_durable_queues
        queue = kombu.entity.Queue(name=topic, channel=channel,
                                   auto_delete=False, exclusive=False,
                                   durable=durable)
        queue.delete()
github openstack / blazar / climate / openstack / common / rpc / impl_kombu.py View on Github external
def reconnect(self, channel):
        super(NotifyPublisher, self).reconnect(channel)

        # NOTE(jerdfelt): Normally the consumer would create the queue, but
        # we do this to ensure that messages don't get dropped if the
        # consumer is started after we do
        queue = kombu.entity.Queue(channel=channel,
                                   exchange=self.exchange,
                                   durable=self.durable,
                                   name=self.routing_key,
                                   routing_key=self.routing_key,
                                   queue_arguments=self.queue_arguments)
        queue.declare()
github openstack / ironic / ironic / openstack / common / rpc / impl_kombu.py View on Github external
def reconnect(self, channel):
        """Re-declare the queue after a rabbit reconnect."""
        self.channel = channel
        self.kwargs['channel'] = channel
        self.queue = kombu.entity.Queue(**self.kwargs)
        self.queue.declare()
github quantmind / pulsar / pulsar / mq / pidbox.py View on Github external
def get_reply_queue(self, ticket):
        return Queue("%s.%s" % (ticket, self.reply_exchange.name),
                     exchange=self.reply_exchange,
                     routing_key=ticket,
                     durable=False,
                     auto_delete=True)
github tuskar / tuskar / tuskar / openstack / common / rpc / impl_kombu.py View on Github external
def reconnect(self, channel):
        """Re-declare the queue after a rabbit reconnect"""
        self.channel = channel
        self.kwargs['channel'] = channel
        self.queue = kombu.entity.Queue(**self.kwargs)
        self.queue.declare()
github openstack / trove / trove / openstack / common / rpc / impl_kombu.py View on Github external
def reconnect(self, channel):
        """Re-declare the queue after a rabbit reconnect."""
        self.channel = channel
        self.kwargs['channel'] = channel
        self.queue = kombu.entity.Queue(**self.kwargs)
        self.queue.declare()
github ansible / awx / awx / lib / site-packages / celery / utils / __init__.py View on Github external
def worker_direct(hostname):
    """Return :class:`kombu.Queue` that is a direct route to
    a worker by hostname.

    :param hostname: The fully qualified node name of a worker
                     (e.g. ``w1@example.com``).  If passed a
                     :class:`kombu.Queue` instance it will simply return
                     that instead.
    """
    if isinstance(hostname, Queue):
        return hostname
    return Queue(WORKER_DIRECT_QUEUE_FORMAT.format(hostname=hostname),
                 WORKER_DIRECT_EXCHANGE,
                 hostname, auto_delete=True)
github openstack / sahara / savanna / openstack / common / rpc / impl_kombu.py View on Github external
def reconnect(self, channel):
        super(NotifyPublisher, self).reconnect(channel)

        # NOTE(jerdfelt): Normally the consumer would create the queue, but
        # we do this to ensure that messages don't get dropped if the
        # consumer is started after we do
        queue = kombu.entity.Queue(channel=channel,
                                   exchange=self.exchange,
                                   durable=self.durable,
                                   name=self.routing_key,
                                   routing_key=self.routing_key,
                                   queue_arguments=self.queue_arguments)
        queue.declare()
github cloudbase / cloudbase-init / cloudbaseinit / openstack / common / rpc / impl_kombu.py View on Github external
def reconnect(self, channel):
        """Re-declare the queue after a rabbit reconnect."""
        self.channel = channel
        self.kwargs['channel'] = channel
        self.queue = kombu.entity.Queue(**self.kwargs)
        self.queue.declare()
github openstack / keystone / keystone / openstack / common / rpc / impl_kombu.py View on Github external
def reconnect(self, channel):
        super(NotifyPublisher, self).reconnect(channel)

        # NOTE(jerdfelt): Normally the consumer would create the queue, but
        # we do this to ensure that messages don't get dropped if the
        # consumer is started after we do
        queue = kombu.entity.Queue(channel=channel,
                                   exchange=self.exchange,
                                   durable=self.durable,
                                   name=self.routing_key,
                                   routing_key=self.routing_key,
                                   queue_arguments=self.queue_arguments)
        queue.declare()