Add MQTT bridge implementation for OpenEMS Edge#3458
Merged
sfeilmeier merged 12 commits intoOpenEMS:developfrom Dec 6, 2025
Merged
Add MQTT bridge implementation for OpenEMS Edge#3458sfeilmeier merged 12 commits intoOpenEMS:developfrom
sfeilmeier merged 12 commits intoOpenEMS:developfrom
Conversation
Introduces the 'io.openems.edge.bridge.mqtt' module, providing MQTT communication support for OpenEMS Edge with MQTT 3.1, 3.1.1, and 5.0 via HiveMQ client. Adds configuration, connection handlers, API interfaces, and subscription management. Updates build and application files to include the new bridge and its dependencies.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #3458 +/- ##
=============================================
- Coverage 59.54% 59.38% -0.16%
Complexity 112 112
=============================================
Files 2901 2912 +11
Lines 124935 125408 +473
Branches 9357 9394 +37
=============================================
+ Hits 74381 74459 +78
- Misses 47737 48122 +385
- Partials 2817 2827 +10 🚀 New features to boost your workflow:
|
This commit replaces the HiveMQ client with the Eclipse Paho client for both MQTT 3.x and MQTT 5.0 connection handlers in the MQTT bridge component. The change includes adapting the connection, publishing, subscription, and disconnection logic to utilize the Eclipse Paho API. This upgrade addresses compatibility issues with the previous client and improves the stability and flexibility of MQTT communications. The implementation now supports detailed configuration options provided by Eclipse Paho, such as automatic reconnection handling, advanced authentication mechanisms, and Last Will and Testament (LWT) features. Additionally, the commit introduces a custom reconnection strategy and enhances the handling of MQTT message subscriptions and deliveries, ensuring more robust and reliable MQTT service integration.
This commit updates the MQTT dependencies for the io.openems.edge.bridge.mqtt module. Specifically, it adds bcpkix and bcprov with version 1.78.1 to the buildpath, and replaces the com.hivemq:hivemq-mqtt-client-shaded and io.reactivex.rxjava2.rxjava dependencies with io.openems.wrapper.paho-mqttv5, org.eclipse.paho.client.mqttv3, and org.eclipse.paho.mqttv5.client, all versioned at 1.2. This change aims to standardize MQTT client usage across the project and ensure compatibility with the latest MQTT protocol versions.
This commit introduces unit tests for MQTT connection handlers across different MQTT protocol versions (3.1, 3.1.1, and 5). It includes tests for constructor behavior, connection status checks, publish/subscribe/unsubscribe operations when not connected, and topic matching with various wildcard scenarios. The tests ensure that the connection handlers behave as expected across different scenarios, including handling SSL connections, and correctly interpreting MQTT quality of service (QoS) levels. This comprehensive test suite aims to improve the reliability and robustness of the MQTT bridge by validating its core functionalities.
Collaborator
Author
|
@sfeilmeier @da-Kai would be ready to Review |
da-Kai
requested changes
Dec 1, 2025
io.openems.edge.bridge.mqtt/src/io/openems/edge/bridge/mqtt/BridgeMqttImpl.java
Outdated
Show resolved
Hide resolved
io.openems.edge.bridge.mqtt/src/io/openems/edge/bridge/mqtt/BridgeMqttImpl.java
Outdated
Show resolved
Hide resolved
io.openems.edge.bridge.mqtt/src/io/openems/edge/bridge/mqtt/BridgeMqttImpl.java
Outdated
Show resolved
Hide resolved
io.openems.edge.bridge.mqtt/src/io/openems/edge/bridge/mqtt/Mqtt3ConnectionHandler.java
Outdated
Show resolved
Hide resolved
io.openems.edge.bridge.mqtt/src/io/openems/edge/bridge/mqtt/Mqtt5ConnectionHandler.java
Outdated
Show resolved
Hide resolved
This commit introduces a dummy implementation of the MQTT bridge (`DummyBridgeMqtt.java`) and its corresponding unit tests (`BridgeMqttImplTest.java`). Additionally, it includes package information (`package-info.java`) for proper OSGi bundle export. The dummy implementation is designed for use in unit testing by providing a mock MQTT bridge environment. This allows for testing of MQTT-related functionalities without the need for an actual MQTT broker connection. The removal of the Checkstyle build command and nature from the `.project` file suggests a simplification of the build process, possibly to streamline development or due to the Checkstyle configuration being managed differently.
Co-Authored-By: da Kai <[email protected]>
da-Kai
approved these changes
Dec 2, 2025
This commit removes the HiveMQ MQTT client shaded dependency from the cnf/pom.xml file. As it is not needed!
sfeilmeier
approved these changes
Dec 6, 2025
Co-authored-by: Felix S <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduces the 'io.openems.edge.bridge.mqtt' module, providing MQTT communication support for OpenEMS Edge with MQTT 3.1, 3.1.1, and 5.0 via HiveMQ client. Adds configuration, connection handlers, API interfaces, and subscription management. Updates build and application files to include the new bridge and its dependencies.
Based on #1408