如何删除在rabbitmq中发布和接收的消息 我正在使用python测试rabitmq,同样的消息继续发布和接收,如何避免这种情况。 如何删除已发布和已接收的消息
答案 0 :(得分:0)
请遵循:
https://www.rabbitmq.com/tutorials/tutorial-two-python.html
幸运的是你没有发送确认:
def callback(ch, method, properties, body):
print " [x] Received %r" % (body,)
time.sleep( body.count('.') )
print " [x] Done"
ch.basic_ack(delivery_tag = method.delivery_tag) ### <--- this one
channel.basic_consume(callback,
queue='hello')