Exemple #1
0
def delete_queue(context, topic):
    if CONF.rpc_backend == "rainicorn.openstack.common.rpc.impl_kombu":
        connection = openstack_rpc.create_connection()
        channel = connection.channel
        durable = connection.conf.rabbit_durable_queues
        queue = kombu.entity.Queue(name=topic, channel=channel,
                                   auto_delete=False, exclusive=False,
                                   durable=durable)
        queue.delete()
Exemple #2
0
    def start(self):
        super(Service, self).start()

        self.conn = rpc.create_connection(new=True)
        LOG.debug(_("Creating Consumer connection for Service %s") % self.topic)

        dispatcher = rpc_dispatcher.RpcDispatcher([self.manager])

        # Share this same connection for these Consumers
        self.conn.create_consumer(self.topic, dispatcher, fanout=False)

        node_topic = "%s.%s" % (self.topic, self.host)
        self.conn.create_consumer(node_topic, dispatcher, fanout=False)

        self.conn.create_consumer(self.topic, dispatcher, fanout=True)

        # Hook to allow the manager to do other initializations after
        # the rpc connection is created.
        if callable(getattr(self.manager, "initialize_service_hook", None)):
            self.manager.initialize_service_hook(self)

        # Consume from all consumers in a thread
        self.conn.consume_in_thread()