Skip to main content

amqpconsumer

A Python module to facilitate listening for and acting on AMQP events.

Usage

Example:

import logging

from amqpconsumer.events import EventConsumer


def handler(event):
    print("Got event:", event)


def main():
    logging.basicConfig(level=logging.INFO)
    consumer = EventConsumer('amqp://guest:guest@localhost:5672/%2f',
                             'testqueue',
                             handler)
    try:
        consumer.run()
    except KeyboardInterrupt:
        consumer.stop()


if __name__ == '__main__':
    main()

Tracing

For every consumed message the consumer extracts OpenTelemetry trace context from the AMQP message headers and wraps the handler call in a consumer span, continuing the publisher’s trace when the message carries one (messages without trace headers simply start a trace of their own). This only depends on opentelemetry-api, for applications without a configured OpenTelemetry backend all tracing calls are no-ops and the behaviour is unchanged. To get the spans into your tracing backend, configure an OpenTelemetry SDK in your application (for example by enabling the Sentry SDK’s OpenTelemetry support).

Running tests

Install uv and run uv run pytest tests.

About

This software is brought to you by Byte, a webhosting provider based in Amsterdam, The Netherlands. We specialize in fast and secure Magento hosting and scalable cluster hosting.

Check out our Github page for more open source software or our site to learn about our products and technologies. Look interesting? Reach out about joining the team. Or just drop by for a cup of excellent coffee if you’re in town!

Metadata

Release files for amqpconsumer 1.8.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for amqpconsumer 1.8.1
File Size Uploaded
amqpconsumer-1.8.1.tar.gz 8.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for amqpconsumer 1.8.1
File Interpreter ABI Platform
amqpconsumer-1.8.1-py3-none-any.whl Python 3 none any Details

Total release size: 16.6 kB

Release files / amqpconsumer-1.8.1.tar.gz

Download URL amqpconsumer-1.8.1.tar.gz
Size 8.7 kB
Tags Source
SHA-256 checksum
How to use checksums
968d6e8c0e29779e5d742a6c8d57219850b434d86ad9ca926670a388ff3979b6
BLAKE2b-256 checksum
How to use checksums
d74f77911f8898f88bca11e0e0818c7a0c4dad73a0cf0bd511aa3e71d3da85bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 3, 2026.

Transparency log

Release files / amqpconsumer-1.8.1-py3-none-any.whl

Download URL amqpconsumer-1.8.1-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c5a622cea981a74b11f2252bead403e47fd3d9cd211442e13401b58982baa869
BLAKE2b-256 checksum
How to use checksums
1707ec02f3677d470375044976ee7a2ec2aaec00d9ad0216fd15863e4985369e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 3, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.8.1 This release

2 release files

1.7.4

1 release file

1.7.3

1 release file

1.7.2

1 release file

1.7.1

1 release file

1.7

1 release file

1.6

1 release file

1.5

1 release file

1.4

1 release file

1.3

1 release file

1.1

1 release file

1.0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page