-
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): Add option to use async Jetstream publish #16582
base: master
Are you sure you want to change the base?
feat(outputs.nats): Add option to use async Jetstream publish #16582
Conversation
90a09ef
to
4cd7f12
Compare
Let's merge #16570 first and then rebase this PR. In any case this looks good to me already. |
4cd7f12
to
3f0c6e9
Compare
To achieve higher throughput, add an option to use asynchronous publishing. In benchmarks, asynchronous publishing is significantly faster—up to 16 times in one test. This improvement comes from not having to wait for individual publish acknowledgments, allowing all acknowledgments to be checked at once.
84df24c
to
fa4eb1d
Compare
plugins/outputs/nats/nats.go
Outdated
return fmt.Errorf("publish acknowledgement is an error: %w (retrying)", err) | ||
} | ||
} | ||
case <-time.After(5 * time.Second): |
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.
@kfollesdal @srebhan Can we also make this configurable?
this can come under async
table in TOML config or as a standalone field.
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.
Add option async_ack_timeout to controll timeout for waiting on ack from async publish.
Download PR build artifacts for linux_amd64.tar.gz, darwin_arm64.tar.gz, and windows_amd64.zip. 📦 Click here to get additional PR build artifactsArtifact URLs |
Summary
Solves #16581 by adding option to use async jetstream publish. "Make" up for loose of performance when changing to sync jetstream publisher vs core.
Checklist
Related issues
resolves #16581
based on #16570