eventing
eventing copied to clipboard
Prototype a MQTT Source
Fixes #7207
Proposed Changes
(The main working files are cmd/mqttsource/main.go, config/tools/mqttsource/mqttsource.yaml, the rest is packages installed to use mqtt_paho, generated by using go get paho and go mod vendor)
- Install packages for mqtt_paho
- Prototype an mqtt container source
Notes: For testing
- MQTT needs a source to listen from. For local testing, run this command to open the mosquitto mqtt broker for source.
docker run -it --rm --name mosquitto -p 1883:1883 eclipse-mosquitto:2.0 mosquitto -c /mosquitto-no-auth.conf
- Keep the mqttsource running by go build the file and run
./main -source localhost:1883 -eventType mqtt.event -eventSource mqtt://localhost:1883 -topic "test-topic"
- Send a message to the same topic, using
mosquitto_pub -t 'test-topic' -m '{"specversion" : "1.0","type" :"com.example.someevent", "id" : "1234-1234-1234","source" : "/mycontext/subcontext","data":{"msg":"hello world!"}}' -D PUBLISH user-property Content-Type application/cloudevents+json; charset=utf-8
- The message will be logged and sent to sink.
Hi @ctmphuongg. Thanks for your PR.
I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test
on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.
Once the patch is verified, the new status will be reflected by the ok-to-test
label.
I understand the commands that are listed here.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
Codecov Report
Attention: Patch coverage is 0%
with 58 lines
in your changes are missing coverage. Please review.
Project coverage is 69.26%. Comparing base (
7e1c082
) to head (ba1a157
). Report is 65 commits behind head on main.
Files | Patch % | Lines |
---|---|---|
cmd/mqttsource/main.go | 0.00% | 58 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #7919 +/- ##
==========================================
+ Coverage 69.22% 69.26% +0.04%
==========================================
Files 339 345 +6
Lines 19494 16052 -3442
==========================================
- Hits 13494 11119 -2375
+ Misses 5337 4247 -1090
- Partials 663 686 +23
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
/cc @matzew
Not sure if you have any initial feedback here...
/cc @Leo6Leo
/ok-to-test
Thanks for fixing the review comment! @ctmphuongg /lgtm /cc @pierDipi @creydr @Cali0707
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: Cali0707, ctmphuongg
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [Cali0707]
Approvers can indicate their approval by writing /approve
in a comment
Approvers can cancel approval by writing /approve cancel
in a comment
Just add a blog post for this PR here! Knative Docs #6062