-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat(new source): Initial MQTT Source, #19931 #22752
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: Stephen Wakely <[email protected]>
Thank you @StormStake! I will take a look. |
is it due to release in upcoming version ? |
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.
This looks great. We can release it as a beta
component and see if any issues come up.
Looks likely based on the current state of the PR. |
I noticed that, from what I can tell you can't get what topic the message was sent to from the log event in this version of the source. In my head I think that is pretty fundamental for this type of application, so I think it would make sense to have it added on first release. But I don't really work with MQTT data, so I could be wrong. Otherwise it could always be added in future releases. Does this look like it's headed in the right |
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 @StormStake!
Yeah, let's add a |
Happy to see this merged, thanks all! |
Summary
The base for this PR is #19931, I have put some work into de-duplicating the code between the MQTT source and sink, I also made a few changes to update some of the older documentation to get it to pass tests. I tried to make as few changes to the overall logic of the source/sink as I could while refactoring but I do need some review and guidance on how the source looks now.
I tried to work on some of the unresolved comments from the original PR but I would like a fresh review so that I can work on anything remaining that the source needs to get merged. Feel free to provide any advice on what I have done, I only really have an okay understanding of Rust and not much in the way of knowledge of Vector's internals but I am prepared to learn if that is needed to get this merged.
Change Type
Is this a breaking change?
How did you test this PR?
I used Vector's builtin MQTT sink and the Eclipse Mosquitto MQTT broker along the
mosquitto_sub
andmosquitto_pub
commands provided by Mosquitto to test base functionality. I used the configuration defaults for themosquitto
broker, (No authentication, No TLS, localhost:1883)Vector MQTT source configuration
Does this PR include user facing changes?
Checklist
make check-all
is a good command to run locally. This check isdefined here. Some of these
checks might not be relevant to your PR. For Rust changes, at the very least you should run:
cargo fmt --all
cargo clippy --workspace --all-targets -- -D warnings
cargo nextest run --workspace
(alternatively, you can runcargo test --all
)Cargo.lock
), pleaserun
dd-rust-license-tool write
to regenerate the license inventory and commit the changes (if any). More details here.References
mqtt
source #19931mqtt
source #584