Henson-AMQP¶
A library for interacting with AMQP with a Henson application.
Quickstart¶
# settings.py
AMQP_INBOUND_QUEUE = 'incoming'
AMQP_INBOUND_EXCHANGE = 'incoming'
AMQP_OUTBOUND_EXCHANGE = 'outgoing'
AMQP_INBOUND_ROUTING_KEY = 'outgoing'
AMQP_OUTBOUND_ROUTING_KEY = 'outgoing'
# app.py
from henson import Application
from henson_amqp import AMQP
from . import settings
from .callback import run
app = Application('app', callback=run)
app.config.from_object(settings)
amqp = AMQP(app)
app.consumer = amqp.consumer()
# Enable optional Retry support
from henson.contrib.retry import Retry
app.settings['RETRY_CALLBACK'] = app.consumer.retry
Retry(app)
$ henson run app
Contents: