Good Python library for AMQP [closed] Good Python library for AMQP [closed] python python

Good Python library for AMQP [closed]


My own research led me to believe that the right library to use would be Kombu, as this is also what Celery (mentioned by @SteveMc) has transitioned to. I am also using RabbitMQ and have used Kombu with the default amqplib backend successfully.

Kombu also supports other transports behind the same API. Useful if you need to replace AMQP or add something like redis to the mix. Haven't tried that though.

Sidenote: Kombu does currently not support the latest pika release (should you rely on it for some reason). Only 5.2.0 is currently supported, this bit me a while back.


Pika is the RabbitMQ recommended library, and py-ampqlib is also mentioned. Depending on what you're using Rabbit for, you might also want to look at Celery (a client library dedicated to distributed queuing).

Again, depending on usage, you might also want to look at Apache's qpid which is a full AMPQ-based client-server alternative to RabbitMQ. One thing that attracted us to qpid was that it seemed to have better robustness on server crashes (queues are persisted in a distributed fashion).


Having looked at all these libraries, I am now convinced that the right answer is none of them. Instead, build an abstraction layer as a shim over whatever library you choose because you are bound to run into a situation where you have to change libraries.

But do remember, that if you stick to the same version of the AMQP protocol, these libraries do interoperate. Due to different libraries being tested, we had parts of a prototype application running pika, kombu and py-amqplib.

Read this blog about replacing amqplib with pika for a sense of why this is a good idea.