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!
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file amqpconsumer-1.8.1.tar.gz.
File metadata
- Download URL: amqpconsumer-1.8.1.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
968d6e8c0e29779e5d742a6c8d57219850b434d86ad9ca926670a388ff3979b6
|
|
| MD5 |
83c62ea0dd616b95484fb9439d963668
|
|
| BLAKE2b-256 |
d74f77911f8898f88bca11e0e0818c7a0c4dad73a0cf0bd511aa3e71d3da85bf
|
Provenance
The following attestation bundles were made for amqpconsumer-1.8.1.tar.gz:
Publisher:
pypi-publish.yml on ByteInternet/amqpconsumer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
amqpconsumer-1.8.1.tar.gz -
Subject digest:
968d6e8c0e29779e5d742a6c8d57219850b434d86ad9ca926670a388ff3979b6 - Sigstore transparency entry: 2698009304
- Sigstore integration time:
-
Permalink:
ByteInternet/amqpconsumer@031369a239b609123df16f36e58389c2662674f3 -
Branch / Tag:
refs/tags/1.8.1 - Owner: https://github.com/ByteInternet
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@031369a239b609123df16f36e58389c2662674f3 -
Trigger Event:
release
-
Statement type:
File details
Details for the file amqpconsumer-1.8.1-py3-none-any.whl.
File metadata
- Download URL: amqpconsumer-1.8.1-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c5a622cea981a74b11f2252bead403e47fd3d9cd211442e13401b58982baa869
|
|
| MD5 |
3ecf063f5d20f04b5c70c033419edcbc
|
|
| BLAKE2b-256 |
1707ec02f3677d470375044976ee7a2ec2aaec00d9ad0216fd15863e4985369e
|
Provenance
The following attestation bundles were made for amqpconsumer-1.8.1-py3-none-any.whl:
Publisher:
pypi-publish.yml on ByteInternet/amqpconsumer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
amqpconsumer-1.8.1-py3-none-any.whl -
Subject digest:
c5a622cea981a74b11f2252bead403e47fd3d9cd211442e13401b58982baa869 - Sigstore transparency entry: 2698009353
- Sigstore integration time:
-
Permalink:
ByteInternet/amqpconsumer@031369a239b609123df16f36e58389c2662674f3 -
Branch / Tag:
refs/tags/1.8.1 - Owner: https://github.com/ByteInternet
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@031369a239b609123df16f36e58389c2662674f3 -
Trigger Event:
release
-
Statement type: