Polyconseil / aioamqp

AMQP implementation using asyncio
Other
280 stars 88 forks source link

The correct way of handling connection problems #144

Closed greatvovan closed 7 years ago

greatvovan commented 7 years ago

What is the correct approach of keeping application running in case of Rabbit connection problems? I am imitating connection issues by disconnecting network cable (or enabling/disabling network adapter in Windows).

I tried:

Neither of this makes library reconnect in my test case. I am getting the following results:

In the first case it is even impossible to identify that a problem exists, as everything looks like just there is no messages. Does anybody have any idea?

My environment:

clodo commented 7 years ago

Hi @greatvovan, I have the same problem and I am trying this approach from pika library using futures and add_done_callback. If it works, I'll let you know.

RemiCardona commented 7 years ago

Honestly, without reading your code, it's impossible to say where the issue is. The code in #65 is what I have had in production for months now and it's pretty robust.

Like I said in #65, the on_error callback is busted, don't use it.

If you can't provide a sample code that breaks, there's nothing I can do to help you out. Sorry.