gocept.amqprun is a Python module that helps you writing and running AMQP consumers. It currently only supports AMQP 0-8 and integrates with the Zope Tool Kit (ZTK) so you can use adapters, utilities and all the buzz.
Basic concepts and terms
- A message handler is a function which is bound with a routing key to exactly one queue. It is called for each message on that queue, and may return a list of messages as a result.
- The result messages of one handled message are sent in one transaction together with the ACK of the handled message.
- When an exception is raised during message processing, the transaction is aborted. (The received message would be NACKed if RabbitMQ was supporting it.)
- A message handler handles exactly one message at a time. Multiple messages can be processed at the same time using threads. Those threads are called workers.
Things you don't need to take care of
- Threading of multiple workers
- Socket handling and locking for communicating with the AMQP broker
- Transaction handling
- Message Ids
- Each outgoing message gets a email-like message id.
- The corrlation id of outoing message is set to the message id of the incomming message.
- Each outgoing message gets a custom references header which is set to the incoming message's reference header plus the eincoming message's message id.
Product's homepage
Requirements:
· Python
What's New in This Release: [ read full changelog ]
· Fix race condition that caused messages to be acknowledged on a different channel than they were received on (#10635).
· Fix race condition that caused attempts at sending messages before the server was started properly (#10620).