def start_rmq_consume(self):
"""
start consuming from rmq
:return:
"""
logger = logging.getLogger(self.__class__.__name__)
logger.info("starting rabbit mq consumer")
channel = self._conn.channel()
# prep a consumer for the from_queue only
self._queue_consumer = Consumer(channel=channel,
queues=[self._from_queue],
callbacks=[self.process_message])
self._queue_consumer.consume()
评论列表
文章目录