- 我正在使用生产者池组向 rabbitmq 发布消息,但是发布调用失败并出现以下错误:
.
File "pubsub.py", line 314, in _publish
producer.publish(message, exchange=exchange, routing_key=topic)
File "/opt/ENV/local/lib/python2.7/site-packages/kombu/messaging.py", line 172, in publish routing_key,
mandatory, immediate, exchange, declare)
File "/opt/ENV/local/lib/python2.7/site-packages/kombu/messaging.py", line 188, in _publish
mandatory=mandatory, immediate=immediate,
File "/opt/local/lib/python2.7/site-packages/librabbitmq/__init__.py", line 117, in basic_publish
mandatory or False, immediate or False,
ConnectionError: Couldn't revive channel
奇怪的是,我收到此错误的消息之前的消息没有到达消费者端。我在 Connection 对象上使用 transport_options={'confirm_publish': True} ,该对象被传递给生产者池。
rabbitmq 服务器位于 AWS 上的 ELB 后面。
关于上面这个错误的任何想法以及为什么消息可能会丢失?
谢谢。