Skip to main content

Rejected is a Python RabbitMQ Consumer Framework and Controller Daemon

Project description

Rejected is a AMQP consumer daemon and message processing framework. It allows for rapid development of message processing consumers by handling all of the core functionality of communicating with RabbitMQ and management of consumer processes.

Rejected runs as a master process with multiple consumer configurations that are each run it an isolated process. It has the ability to collect statistical data from the consumer processes and report on it.

Version Downloads Status Coverage License

Features

  • Dynamic QoS

  • Automatic exception handling including connection management and consumer restarting

  • Smart consumer classes that can automatically decode and deserialize message bodies based upon message headers

  • Metrics logging and submission to statsd

  • Built-in profiling of consumer code

Documentation

https://rejected.readthedocs.org

Example Consumer

from rejected import consumer
import logging

LOGGER = logging.getLogger(__name__)


class Test(consumer.Consumer):
    def process(self, message):
        LOGGER.debug('In Test.process: %s' % message.body)

Example Configuration

%YAML 1.2
---
Application:
  poll_interval: 10.0
  log_stats: True
  statsd:
    enabled: True
    host: localhost
    port: 8125
  Connections:
    rabbitmq:
      host: localhost
      port: 5672
      user: guest
      pass: guest
      ssl: False
      vhost: /
      heartbeat_interval: 300
  Consumers:
    example:
      consumer: rejected.example.Consumer
      connections: [rabbitmq]
      qty: 2
      queue: generated_messages
      dynamic_qos: True
      ack: True
      max_errors: 100
      config:
        foo: True
        bar: baz

 Daemon:
   user: rejected
   group: daemon
   pidfile: /var/run/rejected/example.%(pid)s.pid

 Logging:
   version: 1
   formatters:
     verbose:
       format: "%(levelname) -10s %(asctime)s %(process)-6d %(processName) -15s %(name) -25s %(funcName) -20s: %(message)s"
       datefmt: "%Y-%m-%d %H:%M:%S"
     syslog:
       format: "%(levelname)s <PID %(process)d:%(processName)s> %(name)s.%(funcName)s(): %(message)s"
   filters: []
   handlers:
     console:
       class: logging.StreamHandler
       formatter: verbose
       debug_only: true
     syslog:
       class: logging.handlers.SysLogHandler
       facility: local6
       address: /var/run/syslog
       #address: /dev/log
       formatter: syslog
   loggers:
     my_consumer:
       level: INFO
       propagate: true
       handlers: [console, syslog]
     rejected:
       level: INFO
       propagate: true
       handlers: [console, syslog]
     urllib3:
       level: ERROR
       propagate: true
   disable_existing_loggers: false
   incremental: false

Version History

Available at https://rejected.readthedocs.org/en/latest/history.html

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

rejected-3.4.5.tar.gz (25.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rejected-3.4.5-py2-none-any.whl (32.5 kB view details)

Uploaded Python 2

File details

Details for the file rejected-3.4.5.tar.gz.

File metadata

  • Download URL: rejected-3.4.5.tar.gz
  • Upload date:
  • Size: 25.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for rejected-3.4.5.tar.gz
Algorithm Hash digest
SHA256 ead6da647caa057028318fae53151505cf9c77426558df71722ea1ded8b6c1c9
MD5 684dca0af5cc552d524a32fe0416b2ba
BLAKE2b-256 b74a3fd8fb79d3418a63e3764c98e1cb0f2d0c38b02998c65e8b3eee2daba98d

See more details on using hashes here.

File details

Details for the file rejected-3.4.5-py2-none-any.whl.

File metadata

File hashes

Hashes for rejected-3.4.5-py2-none-any.whl
Algorithm Hash digest
SHA256 5059da40145619f0209cde6e8206145ab48b1d9e5ccde73ab3b3a24950d4fb50
MD5 5fff43cb63cccfbc1934f7b69fdef293
BLAKE2b-256 de704a126fbba5c5ffb825a843866298b5ef637cb27b2d0b1ee01ec1576c2efe

See more details on using hashes here.

Supported by

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