-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat(outputs.nats): Use Jetstream publisher when using Jetstream #16570
Conversation
73b824c
to
eb28751
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @kfollesdal for your contribution! How about keeping the publish path synchronous? Do you plan to move this out of draft soon? If so we might be able to get this into the next feature release on Monday...
Thanks @srebhan, will try to finish up the next two days. You prefer synchronous over asynchronous? Think you will get some performance loss vs core implementation by using synchronous JetStream publisher since you then have to wait on each publish ack instead of check all at once at the end. |
But of order is important synchronous is probably best. And then we do not get any breaking change. But maybe an option to choose between asynchronous and synchronous to keep high throughput as with core publisher? |
Let's first fix this issue and discuss synchronous vs. asynchronous in a separate PR! What do you think? |
The NATS output plugin use the NATS Core publisher both for Core and Jetstream. This can be problematic when publishing many messages to a Jetsteam, e.w you can overload the server. This commit change publisher to use Jetstream publisher insted of Core when publishing to Jetstream. _sync
eb28751
to
977bea8
Compare
Good plan. Have updated PR to use synchronous jetstream publisher insted of proposed asynchronous. We get lower throughput but no braking change with ordering. Asynchronous publish should probably be optional with an option. But that is for another PR. |
Download PR build artifacts for linux_amd64.tar.gz, darwin_arm64.tar.gz, and windows_amd64.zip. 👍 This pull request doesn't change the Telegraf binary size 📦 Click here to get additional PR build artifactsArtifact URLs |
@srebhan I don't see any indication that the failing integration test is related to NATS. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @kfollesdal!
Summary
The NATS output plugin use the NATS Core publisher both for Core and Jetstream. This can be problematic when publishing many messages to a Jetsteam, you do not have
pack
and can overload the server. This PR change publisher to use Jetstream publisher insted of Core when publishing to Jetstream.Checklist
Related issues
resolves #16571