feat(mqtt source, mqtt sink): add MQTT v5 protocol support#25587
feat(mqtt source, mqtt sink): add MQTT v5 protocol support#25587vitalvas wants to merge 9 commits into
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9cd665493e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…expiry for acknowledgements
…ocol # Conflicts: # src/sinks/mqtt/sink.rs
|
I have read the CLA Document and I hereby sign the CLA |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3fcb871c61
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
rtrieu
left a comment
There was a problem hiding this comment.
some minor suggestions to comply with our style guide
| type: string: {} | ||
| } | ||
| connect_properties: { | ||
| description: "MQTT v5 connection properties. Only used when protocol_version is v5." |
There was a problem hiding this comment.
| description: "MQTT v5 connection properties. Only used when protocol_version is v5." | |
| description: "MQTT v5 connection properties. Only applicable when `protocol_version` is `v5`." |
| All subscriptions are made at MQTT QoS 1 (AtLeastOnce), and MQTT wildcards | ||
| are supported: | ||
|
|
||
| - `+` matches exactly one topic level (for example `sensors/+/temperature`) |
There was a problem hiding this comment.
| - `+` matches exactly one topic level (for example `sensors/+/temperature`) | |
| - `+` matches exactly one topic level (for example ,`sensors/+/temperature`) |
| are supported: | ||
|
|
||
| - `+` matches exactly one topic level (for example `sensors/+/temperature`) | ||
| - `#` matches zero or more trailing levels (for example `sensors/#`) |
There was a problem hiding this comment.
| - `#` matches zero or more trailing levels (for example `sensors/#`) | |
| - `#` matches zero or more trailing levels (for example ,`sensors/#`) |
| } | ||
| } | ||
| payload_format_indicator: { | ||
| description: "MQTT v5 payload format indicator. 0 indicates unspecified bytes and 1 indicates UTF-8 encoded data. Absent for v3.1.1 messages or v5 messages without the property set." |
There was a problem hiding this comment.
| description: "MQTT v5 payload format indicator. 0 indicates unspecified bytes and 1 indicates UTF-8 encoded data. Absent for v3.1.1 messages or v5 messages without the property set." | |
| description: "MQTT v5 payload format indicator. 0 indicates unspecified bytes, and 1 indicates UTF-8 encoded data. Absent for v3.1.1 messages or v5 messages without the property set." |
| protocol_versions: { | ||
| title: "MQTT 3.1.1 and 5.0 support" | ||
| body: """ | ||
| The sink supports both MQTT 3.1.1 (default) and MQTT 5.0, selected via the |
There was a problem hiding this comment.
| The sink supports both MQTT 3.1.1 (default) and MQTT 5.0, selected via the | |
| The sink supports both MQTT 3.1.1 (default) and MQTT 5.0, selected using the |
| title: "MQTT v5 publish properties" | ||
| body: """ | ||
| When `protocol_version` is set to `v5`, the sink can attach MQTT 5.0 publish | ||
| properties to outgoing messages via the `publish_properties` section. Supported |
There was a problem hiding this comment.
| properties to outgoing messages via the `publish_properties` section. Supported | |
| properties to outgoing messages through the `publish_properties` section. Supported |
Summary
mqttsource andmqttsink, selectable via a newprotocol_versionoption (defaults tov311for backward compatibility).publish_propertiesconfig section, and surface incoming v5 properties as source event metadata.
mqttsource: when enabled, the source switches to MQTT manual ack mode and only sendsPubAckto the broker once Vector has delivered the event downstream, providing at-least-once semantics for both v3.1.1 and v5.
jsonencodes all three; usenative_jsonfor lossless Vector-to-Vector pipelines). Mis-routed event types are now rejected at config build time instead of silently dropped by the codec.
open_connectionsandconnection_shutdown_totaltelemetry from both source and sink, plus richercomponent_errors_totalcoverage for connection, subscribe, and acknowledgement failures.common::mqtt::build_connectorto keep the source and sink in sync.Vector configuration
How did you test this PR?
(v3 and v5, all 7 v5 fields, no-op on non-log events), and direction tagging on connection errors. 25 mqtt unit tests pass.
protocol_versionremainsv311and existing configurations behave unchanged.Change Type
Is this a breaking change?
Does this PR include user facing changes?
no-changeloglabel to this PR.References
Notes
@vectordotdev/vectorto reach out to us regarding this PR.pre-pushhook, please see this template.make fmtmake check-clippy(if there are failures it's possible some of them can be fixed withmake clippy-fix)make testgit merge origin masterandgit push.Cargo.lock), pleaserun
make build-licensesto regenerate the license inventory and commit the changes (if any). More details on the dd-rust-license-tool.