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

MQTT support #203

Merged
merged 68 commits into from
Oct 12, 2021
Merged

MQTT support #203

merged 68 commits into from
Oct 12, 2021

Conversation

suchen-sci
Copy link
Contributor

@suchen-sci suchen-sci commented Aug 23, 2021

Currently, the support MQTT client connects and publishes a message to Easegress, and Easegress will push the message to the Kafka backend.

Now, this code has been passed the test on customer's environment, and can be reviewed offically.

pkg/object/mqttproxy

backend.go

  • code for Kafka producer
  • use publish to produce msg to Kafka backend

broker.go

  • Broker to connect all other module, like client, session, topic, backend etc
  • newBroker to create new broker and run
  • Broker.registerAPIs for http endpoint

client.go

current client connection to broker, process mqtt packets

mqttproxy.go

define all staff related easegress object

session_manager.go

manage session, store session and get session for certain client

session.go

session info for certain client

spec.go

parameters for mqtt proxy

topic.go

  • code about client subscribe and unsubscribe certain topic, support wildcard for topic "#+"
  • code for topic mapper, map multi-level mqtt topic to kafka topic and headers

@suchen-sci suchen-sci added enhancement New feature or request go Pull requests that update Go code labels Aug 23, 2021
Copy link

@megaeasex megaeasex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[TASK:easegress-pr-test SUCCESS]megaease/easegress Pull Request 203 Deploy Test Success

@suchen-sci suchen-sci linked an issue Aug 23, 2021 that may be closed by this pull request
@suchen-sci suchen-sci linked an issue Aug 23, 2021 that may be closed by this pull request
@suchen-sci suchen-sci marked this pull request as draft August 24, 2021 08:51
Copy link

@megaeasex megaeasex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[TASK:easegress-pr-test SUCCESS]megaease/easegress Pull Request 203 Deploy Test Success

Copy link

@megaeasex megaeasex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[TASK:easegress-pr-test SUCCESS]megaease/easegress Pull Request 203 Deploy Test Success

Copy link

@megaeasex megaeasex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[TASK:easegress-pr-test SUCCESS]megaease/easegress Pull Request 203 Deploy Test Success

@codecov-commenter
Copy link

codecov-commenter commented Aug 25, 2021

Codecov Report

Merging #203 (0d47117) into main (8059305) will increase coverage by 0.12%.
The diff coverage is 80.54%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #203      +/-   ##
==========================================
+ Coverage   80.12%   80.24%   +0.12%     
==========================================
  Files          44       53       +9     
  Lines        4835     5888    +1053     
==========================================
+ Hits         3874     4725     +851     
- Misses        740      904     +164     
- Partials      221      259      +38     
Impacted Files Coverage Δ
pkg/object/mqttproxy/mqttproxy.go 16.21% <16.21%> (ø)
pkg/object/mqttproxy/broker.go 76.66% <76.66%> (ø)
pkg/object/mqttproxy/backend.go 79.16% <79.16%> (ø)
pkg/object/mqttproxy/client.go 79.86% <79.86%> (ø)
pkg/object/mqttproxy/session.go 81.48% <81.48%> (ø)
pkg/object/mqttproxy/session_manager.go 90.32% <90.32%> (ø)
pkg/object/mqttproxy/spec.go 100.00% <100.00%> (ø)
pkg/object/mqttproxy/storage.go 100.00% <100.00%> (ø)
pkg/object/mqttproxy/topic.go 100.00% <100.00%> (ø)
pkg/object/meshcontroller/spec/spec.go 89.51% <0.00%> (+0.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8059305...0d47117. Read the comment docs.

Copy link

@megaeasex megaeasex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[TASK:easegress-pr-test SUCCESS]megaease/easegress Pull Request 203 Deploy Test Success

pkg/object/mqttproxy/broker.go Outdated Show resolved Hide resolved
pkg/object/mqttproxy/broker.go Outdated Show resolved Hide resolved
pkg/object/mqttproxy/session.go Show resolved Hide resolved
pkg/object/mqttproxy/test_test.go Outdated Show resolved Hide resolved
pkg/object/mqttproxy/broker.go Outdated Show resolved Hide resolved
Copy link
Contributor

@xxx7xxxx xxx7xxxx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@suchen-sci
Copy link
Contributor Author

@xxx7xxxx thanks for your advice!

Copy link

@megaeasex megaeasex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[TASK:easegress-pr-test SUCCESS]megaease/easegress Pull Request 203 Deploy Test Success

Copy link

@megaeasex megaeasex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[TASK:easegress-pr-test SUCCESS]megaease/easegress Pull Request 203 Deploy Test Success

Copy link

@megaeasex megaeasex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[TASK:easegress-pr-test SUCCESS]megaease/easegress Pull Request 203 Deploy Test Success

Copy link

@megaeasex megaeasex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[TASK:easegress-pr-test SUCCESS]megaease/easegress Pull Request 203 Deploy Test Success

Copy link

@megaeasex megaeasex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[TASK:easegress-pr-test SUCCESS]megaease/easegress Pull Request 203 Deploy Test Success

Copy link

@megaeasex megaeasex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[TASK:easegress-pr-test SUCCESS]megaease/easegress Pull Request 203 Deploy Test Success

Copy link

@megaeasex megaeasex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[TASK:easegress-pr-test SUCCESS]megaease/easegress Pull Request 203 Deploy Test Success

Copy link

@megaeasex megaeasex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[TASK:easegress-pr-test FAILED]megaease/easegress Pull Request 203 Deploy Test failed

Copy link

@megaeasex megaeasex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[TASK:easegress-pr-test SUCCESS]megaease/easegress Pull Request 203 Deploy Test Success

pkg/object/mqttproxy/broker.go Show resolved Hide resolved
pkg/object/mqttproxy/session_manager.go Outdated Show resolved Hide resolved
Copy link

@megaeasex megaeasex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[TASK:easegress-pr-test SUCCESS]megaease/easegress Pull Request 203 Deploy Test Success

@xxx7xxxx xxx7xxxx merged commit bb1cf77 into easegress-io:main Oct 12, 2021
@suchen-sci suchen-sci deleted the mqtt-support branch November 30, 2021 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request go Pull requests that update Go code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature] MQTT Proxy for Message Queue
9 participants