Skip to content
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

Prototype a MQTT Source #7919

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Prototype a MQTT Source #7919

wants to merge 7 commits into from

Conversation

ctmphuongg
Copy link
Contributor

@ctmphuongg ctmphuongg commented May 10, 2024

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

  1. 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
  1. 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"
  1. 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
  1. The message will be logged and sent to sink.

@knative-prow knative-prow bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 10, 2024
Copy link

knative-prow bot commented May 10, 2024

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.

@knative-prow knative-prow bot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels May 10, 2024
Copy link

knative-prow bot commented May 10, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ctmphuongg
Once this PR has been reviewed and has the lgtm label, please assign pierdipi for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

codecov bot commented May 10, 2024

Codecov Report

Attention: Patch coverage is 0% with 56 lines in your changes are missing coverage. Please review.

Project coverage is 69.24%. Comparing base (7e1c082) to head (5038750).
Report is 48 commits behind head on main.

Files Patch % Lines
cmd/mqttsource/main.go 0.00% 56 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7919      +/-   ##
==========================================
+ Coverage   69.22%   69.24%   +0.02%     
==========================================
  Files         339      345       +6     
  Lines       19494    15999    -3495     
==========================================
- Hits        13494    11079    -2415     
+ Misses       5337     4243    -1094     
- Partials      663      677      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Cali0707
Copy link
Member

/cc @matzew

Not sure if you have any initial feedback here...

@knative-prow knative-prow bot requested a review from matzew May 13, 2024 19:24
@ctmphuongg
Copy link
Contributor Author

/cc @Leo6Leo

@knative-prow knative-prow bot requested a review from Leo6Leo May 14, 2024 15:07
@ctmphuongg ctmphuongg marked this pull request as ready for review May 15, 2024 15:58
@knative-prow knative-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 15, 2024
@ctmphuongg ctmphuongg requested a review from Leo6Leo May 15, 2024 15:58
@Leo6Leo
Copy link
Member

Leo6Leo commented May 15, 2024

@ctmphuongg I will take a look today! Thanks for your PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prototype a MQTT Source
3 participants