[rabbitmq-discuss] pika 0.9.6 and Reconnection Strategies
Gavin M. Roy
gmr at meetme.com
Fri Sep 28 16:52:36 BST 2012
I'm trying to get 0.9.6 wrapped up and out the door (finally). If you're a
Python developer and use Pika, I wanted to solicit your feedback.
As I've been going through, adding tests and cleaning up the code, I've
come to the opinion that Reconnection Strategies, at least in their current
form are not very useful. There are a few reasons for this:
1) They do not restore state, meaning your application will still have to
know when you are disconnected and it will have to reestablish all of the
channels and if it's a consumer, re-issue any state based commands, such as
Basic.Consume, Confirm.Select etc. If the ReconnectionStrategy classes
could restore state, I'd see much more value in them.
2) As it is, the apps using the asynchronous adapters can listen for the
connection close event and handle this on their own. Again if anyone was
using the ReconnectionStrategy classes for re-establishing the connection,
they would have to do the rest of the work this way, anyway.
3) BlockingConnection, which seems to be the most popular adapter, can not
use them. Since it currently reimplements the connection closing to raise
an exception when the connection is remotely closed or dropped, it could
not expect the event to be fired. A design decision would have to be made
to force users of BlockingConnection to use an callback for handling
connections being closed in order to support reconnections strategies or
keep it the way it is, which is a more pythonic approach.
That being said, I am leaning towards dropping them as part of the core
library. If I do this, I would include an example that re-implements the
SimpleReconnectionStrategy class as a demo consumer that shows how to
create a reconnectable consumer application.
If you're a pika user, do you use the SRS or your own ReconnectionStrategy
extended class? Are you in favor of removing it or keeping it? If I end up
going the route of removing it, it will mean I can get 0.9.6 out, possibly
this weekend. Keeping it may mean another week or two.
As a side note, 0.9.6pre1 is in the master branch on github and could use
some testing outside of my environment. If you're interested and able, you
can install it via pip install -e git+git://
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rabbitmq-discuss