amqplib 0.2
I noticed the other day that my two RabbitMQ servers were consuming more and more memory - one had gone from an initial 22mb size to over 600mb. As I sat and watched it would grow by 4k or so at regular intervals.
I think what had happened is that I had created an exchange which received lots of messages, and then ran scripts that created automatically-named queues bound to that exchange, but defaulted to not auto-deleting them. I ran these scripts many many times, which left many many queues on the server, all swelling up with lots of messages that would never be consumed. Good thing I caught it, it might have eventually killed my server.
This message in the rabbitmq-discuss list gives useful info on how to get in and see what queues exist on a RabbitMQ server, and how big they are.
It seems to me that having the auto_delete
parameter of Channel.queue_declare()
default to False
is a really bad idea. If you want to keep a queue around after your program exits, I think you should explicitly say so, so I changed the default to True
. The Channel.exchange_declare()
also has a auto_delete
parameter, which I also change the default to True
for consistency.
I also did some work on supporting the redirect feature of AMQP, where a server you connect to can tell you to go somewhere else, useful for balancing a cluster. I don't actually have a RabbitMQ cluster, so I put together a utility to fake an AMQP server that tells you to redirect. It works well enough to run the uniitests unchanged against it, each test case being redirected from the fake server to the real server.
With those two changes, I put out a 0.2 release, on my software page and on the Cheeseshop.