-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aioamqp.exceptions.AmqpClosedConnection #164
Comments
Hi, guys! Any news about this issue? I have the same problem: import asyncio
import aioamqp
async def connect():
transport, protocol = await aioamqp.from_url('amqp://gateway:[email protected]:5672/gateway')
print("connected !")
await asyncio.sleep(10)
print("close connection")
await protocol.close()
transport.close()
asyncio.get_event_loop().run_until_complete(connect()) When I run this code, I have got the following:
Rabbitmq logs shows me the following:
How can I fix the problem? |
There is a bug in aioamqp that the code incorrectly interprets hearbeat with the value of 0. By default heartbeat is set to None on a client side but the server makes the client to use the heartbeat with a value of 0 by sending Connection.Tune method, so to workaround it you need to explicitly set heartbeat with some value except 0 and None. But do not set it in URL because the heartbeat parameter isn't read from that. So you can use the code like this: The problem has already been solved in this PR: |
RabbitMQ log:
Traceback:
Code:
Connection url:
amqp://hanyuu:***@127.0.0.1:5672/test?heartbeat=0&connection_timeout=120000
The text was updated successfully, but these errors were encountered: