enhancement(nats sink): add support for JetStream message headers#23510
Merged
pront merged 13 commits intovectordotdev:masterfrom Aug 6, 2025
Merged
enhancement(nats sink): add support for JetStream message headers#23510pront merged 13 commits intovectordotdev:masterfrom
pront merged 13 commits intovectordotdev:masterfrom
Conversation
40584b7 to
5928220
Compare
benjamin-awd
commented
Aug 2, 2025
5928220 to
91f203e
Compare
91f203e to
b6caeaa
Compare
brett0000FF
approved these changes
Aug 4, 2025
auto-merge was automatically disabled
August 6, 2025 16:06
Head branch was pushed to by a user without write access
Contributor
Author
|
EDIT: figured it out -- I used two slashes instead of three for the Running into a weird issue with jetstream: {
...
required: false
type: object: options: {
enabled: {
description: "Whether to enable Jetstream."
required: false
type: bool: default: false
}I guess there must be something I'm missing from my config here: /// Configuration for sending messages using NATS JetStream.
#[configurable_component]
#[serde_with::serde_as]
#[derive(Clone, Debug, Eq, PartialEq, Default)]
#[serde(deny_unknown_fields)]
pub struct JetStreamConfig {
// Whether to enable Jetstream.
#[configurable(derived)]
#[serde(default)]
pub enabled: bool,
/// A map of NATS headers to be included in each message.
#[configurable(metadata(docs::templateable))]
#[serde(default)]
pub(super) headers: Option<NatsHeaderConfig>,
}
impl From<bool> for JetStreamConfig {
fn from(enabled: bool) -> Self {
Self {
enabled,
..Default::default()
}
}
} |
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support in the
natssink for JetStream message headers.It introduces a configurable, templated
Nats-Msg-Idheader that ensures a unique ID for each message. This enables broker-level deduplication, resulting in stronger delivery guarantees and exactly-once semantics when combined with idempotent consumers.This PR also adds proper integration tests for JetStream.
Vector configuration
How did you test this PR?
Change Type
Is this a breaking change?
Does this PR include user facing changes?
no-changeloglabel to this PR.References
Closes: #23509