def start_consuming(self):
"""Exchange, channel, consumer ready to start listening"""
# send rpc request
self.worker_id = None
self.correlation_id = uuid.uuid4().hex
self._channel.basic_publish(
exchange=self.exchange,
routing_key='%s.worker.%s' % (self.key, self.worker_type),
properties=pika.BasicProperties(
reply_to=self.queue,
correlation_id=self.correlation_id,
content_type='application/json',
),
body=json.dumps(self.worker_kwargs),
)
log.info("%s: sent RPC request, will wait for response.", self.lbl)
super(_HubTornadoConsumer, self).start_consuming()
评论列表
文章目录