Add support for NATS JetStream as a transport#2299
Add support for NATS JetStream as a transport#2299joeriddles wants to merge 19 commits intocelery:mainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
Adds initial support for NATS JetStream as a Kombu transport, including dependency, transport registration, and usage examples.
- Adds
nats-pyextra requirement - Registers the
natstransport in Kombu’s transport registry - Provides example scripts for sending and receiving messages via NATS JetStream
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| requirements/extras/nats.txt | Pins the nats-py[nkeys] dependency |
| kombu/transport/init.py | Registers 'nats' transport for JetStream |
| examples/nats_send.py | Example for publishing messages to JetStream |
| examples/nats_receive.py | Example for consuming messages from JetStream |
Comments suppressed due to low confidence (1)
kombu/transport/init.py:48
- [nitpick] The transport key 'nats' is generic and could conflict with other NATS-based transports; consider renaming it to 'nats_jetstream' to clearly distinguish this implementation.
'nats': 'kombu.transport.nats_jetstream:Transport',
Nusnus
left a comment
There was a problem hiding this comment.
Please ping me when the PR is ready for review. Thank you for working on this!
a263b01 to
f2df5f1
Compare
@Nusnus ready for review! |
for more information, see https://pre-commit.ci
|
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! |
|
Same we are looking to use this, hopefully this will be merged soon ? |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2299 +/- ##
==========================================
- Coverage 81.19% 79.12% -2.08%
==========================================
Files 77 78 +1
Lines 9738 9993 +255
Branches 1098 1120 +22
==========================================
Hits 7907 7907
- Misses 1625 1880 +255
Partials 206 206 ☔ View full report in Codecov by Sentry. |
|
@Nusnus I'll see if I can get the codecov CI passing.. I did add tests so not sure off hand why it's failing. |
Source: celery#2299 Commit: c61a8e3
Source: celery#2299 Commit: c61a8e3
|
Guys you are amazing! |
auvipy
left a comment
There was a problem hiding this comment.
please fix the merge conflicts
closes #2103
Implement support for NATS using its built-in persistence layer JetStream.
Example
You can test using either:
nats-server --jsdemo.nats.ioThe transport can be test using
examples/nats_receive.pyandexamples/nats_send.py:python -m examples.nats_receive(append--demoif using the demo server)python -m examples.nats_send(append--demoif using the demo server)In the receive window, you should see something like: