def attach(self): """ Attach (connect) to AMQP connector using the specified uuid. """ self.detach(False) self.refresh() model = BrokerModel(self) model.setup() node = Node(model.queue) consumer = RequestConsumer(node, self) consumer.authenticator = self.authenticator consumer.start() self.consumer = consumer log.info('plugin:%s, attached => %s', self.name, self.node)
def attach(self, uuid=None): """ Attach (connect) to AMQP broker using the specified uuid. @param uuid: The (optional) messaging UUID. @type uuid: str """ cfg = self.cfg() if not uuid: uuid = self.getuuid() broker = self.getbroker() url = broker.url queue = Queue(uuid) consumer = RequestConsumer(queue, url=url) consumer.start() self.consumer = consumer