RabbitMQ保持关闭连接

2024-10-02 04:35:54 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用rabbitpython库与RabbitMQ交互。我设计了一个具有publisher方法和consumer方法的通信类。此通信类的实例在不同的线程中运行。在

若我开始频繁请求,RabbitMQ会关闭连接。以下是错误日志:

=ERROR REPORT==== 4-Apr-2014::14:12:52 ===
AMQP connection <0.13197.22> (running), channel 1 - error:
{amqp_error,unexpected_frame,
            "expected content header for class 60, got non content header frame instead",
            'basic.publish'}

=INFO REPORT==== 4-Apr-2014::14:12:52 ===
closing AMQP connection <0.13197.22> (127.0.0.1:52234 -> 127.0.0.1:5672)

=INFO REPORT==== 4-Apr-2014::14:12:52 ===
accepting AMQP connection <0.13263.22> (127.0.0.1:52237 -> 127.0.0.1:5672)

rabbitpy是一个线程安全库(它这么说)。在

我为什么有这样的问题?在


Tags: 方法reportinfoamqpconsumerrabbitmqerrorcontent
1条回答
网友
1楼 · 发布于 2024-10-02 04:35:54

看起来问题是多线程。可能是rabbitpy中的一个bug。 解决方法是

  • 避免在来自多个线程的连接内的同一通道上发布
  • 在您自己的代码中同步发布

退房this discussion

相关问题 更多 >

    热门问题