Skip to main content

Simplifies interactions with RabbitMQ by focusing on design patterns based on Topic Exchanges.

Project description

Simplifies interactions with RabbitMQ by focusing on design patterns based on Topic Exchanges. More information can be found here: http://www.rabbitmq.com/tutorials/tutorial-five-python.html

Goals

Embrace Kenneth Reitz’s thoughts on the 90% rule, i.e. requests module.

Messages are serialized as needed, starting from no serialization for strings to json and falling back to yaml if the more simple open serialization methods are not capable of serializing the object/message. i.e. datetime/date/decimal/etc.

#!/usr/bin/env python

from rabbit import Producer

with Producer(uri) as producer:
    for message in <iterable/generator>:
        producer.publish(message, routing_key)
from rabbit import Consumer

with Consumer(uri, exchange, queue, routing_key) as consumer:
    consumer.attach_action(...)
    consumer.handle_messages(...)

or for even more control of exchanges and queues:

from rabbit import Consumer

with Consumer(uri) as consumer:
    consumer.declare_exchange(...)
    consumer.declare_queue(...)
    consumer.attach_action(...)
    consumer.handle_messages(...)

uri is a messge queue uri in the form, mq://user:pass@host/vhost where mq://user:pass@localhost == mq://user:pass@localhost/

Within the uri you can pass user, password, host, port and vhost information. see thumper/test/test_mquri.py for more details

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

thumper-0.0.11.tar.gz (160.3 kB view details)

Uploaded Source

File details

Details for the file thumper-0.0.11.tar.gz.

File metadata

  • Download URL: thumper-0.0.11.tar.gz
  • Upload date:
  • Size: 160.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for thumper-0.0.11.tar.gz
Algorithm Hash digest
SHA256 97aff4368463f6502778fff7a79ee7f9b8b5857fb4c38a7f0d2bea022bb60323
MD5 c70c1efa726db4292f393e010156626f
BLAKE2b-256 8097e475cbe62679ad537251d43c2808f86c2f26a85a15773168c465f227d559

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page