Metadata-Version: 2.4
Name: rejected
Version: 4.0.0b1
Summary: Rejected is a Python RabbitMQ Consumer Framework and Controller Daemon
Project-URL: Homepage, https://github.com/gmr/rejected
Project-URL: Documentation, https://gmr.github.io/rejected
Project-URL: Bug Tracker, https://github.com/gmr/rejected/issues
Project-URL: Source Code, https://github.com/gmr/rejected
Author-email: "Gavin M. Roy" <gavinmroy@gmail.com>
License-Expression: BSD-3-Clause
License-File: LICENSE
Keywords: amqp,consumer,messaging,rabbitmq
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: System :: Networking
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: pika<3,>=1.2.0
Requires-Dist: psutil
Requires-Dist: pydantic<3,>=2
Requires-Dist: pyyaml<7,>=5.3.1
Provides-Extra: avro
Requires-Dist: fastavro>=1.7; extra == 'avro'
Requires-Dist: httpx>=0.27; extra == 'avro'
Provides-Extra: html
Requires-Dist: beautifulsoup4; extra == 'html'
Provides-Extra: msgpack
Requires-Dist: u-msgpack-python; extra == 'msgpack'
Provides-Extra: prometheus
Requires-Dist: prometheus-client>=0.20; extra == 'prometheus'
Provides-Extra: sentry
Requires-Dist: sentry-sdk<3,>=2; extra == 'sentry'
Description-Content-Type: text/markdown

# Rejected

Rejected is an 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 in an isolated process. It has the ability to collect statistical
data from the consumer processes and report on it.

[![Version](https://img.shields.io/pypi/v/rejected.svg?)](https://pypi.python.org/pypi/rejected)
[![License](https://img.shields.io/pypi/l/rejected.svg?)](https://github.com/gmr/rejected/blob/main/LICENSE)

## Features

- Async consumers built on `asyncio`
- Automatic exception handling including connection management and consumer restarting
- Smart consumer classes that automatically decode and deserialize message bodies based on message headers
- Concurrent message processing with `FunctionalConsumer`
- Metrics via statsd and/or Prometheus
- Built-in profiling of consumer code
- Avro schema support with file and HTTP schema registries
- YAML and TOML configuration file support

## Installation

```bash
pip install rejected
```

For optional features:

```bash
pip install rejected[avro]        # Avro datum serialization
pip install rejected[html]        # HTML message body support
pip install rejected[msgpack]     # MessagePack support
pip install rejected[prometheus]  # Prometheus metrics exporter
pip install rejected[sentry]      # Sentry error reporting
```

## Documentation

Full documentation is available at [https://gmr.github.io/rejected](https://gmr.github.io/rejected).

## Example Consumer

```python
import logging

import rejected

LOGGER = logging.getLogger(__name__)


class Test(rejected.Consumer):

    async def process(self) -> None:
        LOGGER.debug('In Test.process: %s', self.body)
```

For concurrent message processing, use `FunctionalConsumer`:

```python
import logging

import rejected

LOGGER = logging.getLogger(__name__)


class Test(rejected.FunctionalConsumer):

    async def process(self, ctx: rejected.ProcessingContext) -> None:
        LOGGER.debug('Processing: %s', ctx.message.body)
```
