kombu
kombu copied to clipboard
Add support for NATS JetStream as a transport
closes #2103
Implement support for NATS using its built-in persistence layer JetStream.
Example
You can test using either:
- Installing the NATS server locally and running it with JetStream enabled:
nats-server --js - Using the demo NATS server at
demo.nats.io
The transport can be test using examples/nats_receive.py and examples/nats_send.py:
- Start the local NATS server (optional)
- Run
python -m examples.nats_receive(append--demoif using the demo server) - In another window, run
python -m examples.nats_send(append--demoif using the demo server)
In the receive window, you should see something like:
Received message: 'hello world'
properties:
{ 'body_encoding': 'base64',
'delivery_info': {'exchange': 'exchange', 'routing_key': 'messages'},
'delivery_mode': 2,
'delivery_tag': 'fa01f1a9-f666-46a0-af71-35e5164e1ad9',
'priority': 0}
delivery_info:
{'exchange': 'exchange', 'routing_key': 'messages'}
Please ping me when the PR is ready for review. Thank you for working on this!
@Nusnus ready for review!
@Nusnus @auvipy I fixed the merge conflicts and rebased on main
tried to fix the merge conflicts, but feel free to improve it
Thanks @auvipy, I fixed tox.ini but otherwise the merge looks good
Just wanted to spread the love. So looking forward for this integration!