https://github.com/nathanborror/flopsy
A very simple way to interact with python AMQPlib.
https://github.com/nathanborror/flopsy
Last synced: 8 months ago
JSON representation
A very simple way to interact with python AMQPlib.
- Host: GitHub
- URL: https://github.com/nathanborror/flopsy
- Owner: nathanborror
- License: bsd-3-clause
- Created: 2009-06-25T16:33:29.000Z (over 16 years ago)
- Default Branch: master
- Last Pushed: 2009-06-26T22:10:08.000Z (over 16 years ago)
- Last Synced: 2025-04-08T08:06:02.872Z (9 months ago)
- Language: Python
- Homepage:
- Size: 83 KB
- Stars: 44
- Watchers: 3
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: README
- License: LICENSE
Awesome Lists containing this project
README
Flopsy
======
A very simple way to interact with python AMQPlib. For my case I'm using
RabbitMQ as my implementation but it should work with others.
settings.py
-----------
AMQP_SERVER = '24.143.38.241'
AMQP_PORT = 5672
AMQP_USER = 'guest'
AMQP_PASSWORD = 'guest'
AMQP_VHOST = '/'
Consumer
--------
>>> import flopsy
>>> consumer = flopsy.Consumer()
>>> def message_callback(message):
... print 'Recieved: ' + message.body
... consumer.channel.basic_ack(message.delivery_tag)
...
>>> consumer.register('message_to_print', message_callback)
>>> consumer.wait()
Publisher
---------
>>> import flopsy
>>> publisher = flopsy.Publisher()
>>> publisher.publish('messages_to_print', 'Test message!')