{"id":16893022,"url":"https://github.com/gmr/rejected","last_synced_at":"2025-07-07T22:04:01.499Z","repository":{"id":666106,"uuid":"309235","full_name":"gmr/rejected","owner":"gmr","description":"rejected is a consumer framework for RabbitMQ","archived":false,"fork":false,"pushed_at":"2024-03-14T17:21:04.000Z","size":1239,"stargazers_count":58,"open_issues_count":2,"forks_count":18,"subscribers_count":8,"default_branch":"main","last_synced_at":"2024-05-02T00:02:47.026Z","etag":null,"topics":["amqp","consumer","framework","hacktoberfest","python","rabbitmq"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gmr.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2009-09-16T22:37:10.000Z","updated_at":"2024-05-06T22:28:50.439Z","dependencies_parsed_at":"2024-01-22T17:37:32.519Z","dependency_job_id":"992825a2-19af-4652-9334-1f7b9c91d465","html_url":"https://github.com/gmr/rejected","commit_stats":{"total_commits":622,"total_committers":17,"mean_commits":"36.588235294117645","dds":0.4758842443729904,"last_synced_commit":"89dedc5f338302f4a823bb6d40d1e19d3fb21037"},"previous_names":[],"tags_count":124,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmr%2Frejected","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmr%2Frejected/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmr%2Frejected/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmr%2Frejected/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gmr","download_url":"https://codeload.github.com/gmr/rejected/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250536246,"owners_count":21446700,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amqp","consumer","framework","hacktoberfest","python","rabbitmq"],"created_at":"2024-10-13T17:13:17.185Z","updated_at":"2025-04-24T00:22:52.650Z","avatar_url":"https://github.com/gmr.png","language":"Python","readme":"Rejected\n========\n\nRejected is a AMQP consumer daemon and message processing framework. It allows\nfor rapid development of message processing consumers by handling all of the\ncore functionality of communicating with RabbitMQ and management of consumer\nprocesses.\n\nRejected runs as a master process with multiple consumer configurations that are\neach run it an isolated process. It has the ability to collect statistical\ndata from the consumer processes and report on it.\n\nRejected supports Python 2.7 and 3.4+.\n\n|Version| |Status| |Coverage| |License|\n\nFeatures\n--------\n\n- Automatic exception handling including connection management and consumer restarting\n- Smart consumer classes that can automatically decode and deserialize message bodies based upon message headers\n- Metrics logging and submission to statsd and InfluxDB\n- Built-in profiling of consumer code\n- Ability to write asynchronous code in consumers allowing for parallel communication with external resources\n\nDocumentation\n-------------\n\nhttps://rejected.readthedocs.io\n\nExample Consumers\n-----------------\n.. code:: python\n\n    from rejected import consumer\n    import logging\n\n    LOGGER = logging.getLogger(__name__)\n\n\n    class Test(consumer.Consumer):\n\n        def process(self, message):\n            LOGGER.debug('In Test.process: %s' % message.body)\n\nAsync Consumer\n^^^^^^^^^^^^^^\nTo make a consumer async, you can decorate the\n`Consumer.prepare \u003chttp://rejected.readthedocs.org/en/latest/api_consumer.html#rejected.consumer.Consumer.prepare\u003e`_\nand `Consumer.process \u003chttp://rejected.readthedocs.org/en/latest/api_consumer.html#rejected.consumer.Consumer.process\u003e`_\nmethods using Tornado's\n`@gen.coroutine \u003chttp://www.tornadoweb.org/en/stable/gen.html#tornado.gen.coroutine\u003e`_.\nAsynchronous consumers do not allow for concurrent processing multiple messages in the same process, but\nrather allow you to use asynchronous clients like\n`Tornado's \u003chttp://tornadoweb.org\u003e`_\n`AsyncHTTPClient \u003chttp://www.tornadoweb.org/en/stable/httpclient.html\u003e`_ and the\n`Queries \u003chttp://queries.readthedocs.org/en/latest/tornado_session.html\u003e`_\nPostgreSQL library to perform parallel tasks using coroutines when processing a single message.\n\n.. code:: python\n\n    import logging\n\n    from rejected import consumer\n\n    from tornado import gen\n    from tornado import httpclient\n\n\n    class AsyncExampleConsumer(consumer.Consumer):\n\n        @gen.coroutine\n        def process(self):\n            LOGGER.debug('Message: %r', self.body)\n            http_client = httpclient.AsyncHTTPClient()\n            results = yield [http_client.fetch('http://www.github.com'),\n                             http_client.fetch('http://www.reddit.com')]\n            LOGGER.info('Length: %r', [len(r.body) for r in results])\n\n\nExample Configuration\n---------------------\n.. code:: yaml\n\n    %YAML 1.2\n    ---\n    Application:\n      poll_interval: 10.0\n      stats:\n        log: True\n        influxdb:\n          enabled: True\n          scheme: http\n          host: localhost\n          port: 8086\n          user: username\n          password: password\n          database: dbname\n        statsd:\n          enabled: True\n          host: localhost\n          port: 8125\n          prefix: applications.rejected\n      Connections:\n        rabbitmq:\n          host: localhost\n          port: 5672\n          user: guest\n          pass: guest\n          ssl: False\n          vhost: /\n          heartbeat_interval: 300\n      Consumers:\n        example:\n          consumer: rejected.example.Consumer\n          sentry_dsn: https://[YOUR-SENTRY-DSN]\n          connections:\n            - name: rabbitmq1\n              consume: True\n          drop_exchange: dlxname\n          qty: 2\n          queue: generated_messages\n          qos_prefetch: 100\n          ack: True\n          max_errors: 100\n          config:\n            foo: True\n            bar: baz\n\n    Daemon:\n      user: rejected\n      group: daemon\n      pidfile: /var/run/rejected/example.%(pid)s.pid\n\n    Logging:\n      version: 1\n      formatters:\n        verbose:\n          format: \"%(levelname) -10s %(asctime)s %(process)-6d %(processName) -25s %(name) -20s %(funcName) -25s: %(message)s\"\n          datefmt: \"%Y-%m-%d %H:%M:%S\"\n        verbose_correlation:\n          format: \"%(levelname) -10s %(asctime)s %(process)-6d %(processName) -25s %(name) -20s %(funcName) -25s: %(message)s {CID %(correlation_id)s}\"\n          datefmt: \"%Y-%m-%d %H:%M:%S\"\n        syslog:\n          format: \"%(levelname)s \u003cPID %(process)d:%(processName)s\u003e %(name)s.%(funcName)s: %(message)s\"\n        syslog_correlation:\n          format: \"%(levelname)s \u003cPID %(process)d:%(processName)s\u003e %(name)s.%(funcName)s: %(message)s {CID %(correlation_id)s)\"\n      filters:\n        correlation:\n          '()': rejected.log.CorrelationFilter\n          'exists': True\n        no_correlation:\n          '()': rejected.log.CorrelationFilter\n          'exists': False\n      handlers:\n        console:\n          class: logging.StreamHandler\n          formatter: verbose\n          debug_only: false\n          filters: [no_correlation]\n        console_correlation:\n          class: logging.StreamHandler\n          formatter: verbose_correlation\n          debug_only: false\n          filters: [correlation]\n        syslog:\n          class: logging.handlers.SysLogHandler\n          facility: daemon\n          address: /var/run/syslog\n          formatter: syslog\n          filters: [no_correlation]\n        syslog_correlation:\n          class: logging.handlers.SysLogHandler\n          facility: daemon\n          address: /var/run/syslog\n          formatter: syslog\n          filters: [correlation]\n      loggers:\n        helper:\n          level: INFO\n          propagate: true\n          handlers: [console, console_correlation, syslog, syslog_correlation]\n        rejected:\n          level: INFO\n          propagate: true\n          handlers: [console, console_correlation, syslog, syslog_correlation]\n        tornado:\n          level: INFO\n          propagate: true\n          handlers: [console, console_correlation, syslog, syslog_correlation]\n      disable_existing_loggers: true\n      incremental: false\n\nVersion History\n---------------\nAvailable at https://rejected.readthedocs.org/en/latest/history.html\n\n.. |Version| image:: https://img.shields.io/pypi/v/rejected.svg?\n   :target: https://pypi.python.org/pypi/rejected\n\n.. |Status| image:: https://img.shields.io/travis/gmr/rejected.svg?\n   :target: https://travis-ci.org/gmr/rejected\n\n.. |Coverage| image:: https://img.shields.io/codecov/c/github/gmr/rejected.svg?\n   :target: https://codecov.io/github/gmr/rejected?branch=master\n\n.. |License| image:: https://img.shields.io/pypi/l/rejected.svg?\n   :target: https://rejected.readthedocs.org\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgmr%2Frejected","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgmr%2Frejected","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgmr%2Frejected/lists"}