[aio-pika RPC模式示例崩溃,并带有:RobustConnection:连接已关闭

问题描述 投票:0回答:1

我正在尝试使用aio-pikaRPC Pattern一起运行RPC。我按原样运行了所有文档,只是更改了AMPQ URL,但出现错误:

Task exception was never retrieved
quart_service_01_1  | future: <Task finished coro=<RobustConnection.reconnect() done, defined at /usr/local/lib/python3.6/site-packages/aio_pika/robust_connection.py:149> exception=RuntimeError('<RobustConnection: "amqp://dev_user:******@rabbit:5672/tgvhost" 1 channels> connection closed',)>
quart_service_01_1  | Traceback (most recent call last):
quart_service_01_1  |   File "/usr/local/lib/python3.6/asyncio/tasks.py", line 180, in _step
quart_service_01_1  |     result = coro.send(None)
quart_service_01_1  |   File "/usr/local/lib/python3.6/site-packages/aio_pika/robust_connection.py", line 150, in reconnect
quart_service_01_1  |     await self.connect()
quart_service_01_1  |   File "/usr/local/lib/python3.6/site-packages/aio_pika/robust_connection.py", line 105, in connect
quart_service_01_1  |     raise RuntimeError("{!r} connection closed".format(self))
quart_service_01_1  | RuntimeError: <RobustConnection: "amqp://dev_user:******@rabbit:5672/tgvhost" 1 channels> connection closed

并且在该跟踪之前,似乎客户端关闭了与Rabbit的连接:

2020-03-20 09:45:23.855 [info] <0.639.0> accepting AMQP connection <0.639.0> (172.30.0.5:40902 -> 172.30.0.3:5672)
rabbit_1            | 2020-03-20 09:45:23.870 [info] <0.639.0> connection <0.639.0> (172.30.0.5:40902 -> 172.30.0.3:5672): user 'dev_user' authenticated and granted access to vhost 'tgvhost'
rabbit_1            | 2020-03-20 09:45:23.917 [info] <0.639.0> closing AMQP connection <0.639.0> (172.30.0.5:40902 -> 172.30.0.3:5672, vhost: 'tgvhost', user: 'dev_user')

如果我尝试从Rabbit MQ aio-pika tutorial实现RPC,则一切正常。我不确定这是错误还是我的配置错误,但我将此兔子设置与pika(不是aio)和nameko框架一起使用,没有任何问题。不,我想迁移到异步夸脱框架,因此我需要使用带有aio-pika的RPC。

Docker兔子MQ 3.7.5aio-pika 6.6.0Python 3.6

python rabbitmq python-asyncio pika
1个回答
0
投票

已解决以下拉取请求:https://github.com/mosquito/aio-pika/pull/308

© www.soinside.com 2019 - 2024. All rights reserved.