Skip to content

Add MQTT5 sample application with integration flows and tests #365

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

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

Conversation

nmy6452
Copy link

@nmy6452 nmy6452 commented Jun 5, 2025

Signed-off-by: Minyoung Noh [email protected]

Create PR for #323 issues.
I worked on the PR base that was rejected before, please refer to it and review it. #364

  1. Update all the copyright date for all .java files to 2025.
  2. Update all @author tag my name
  3. Update tests to use JUnit 5
  4. add project to the list of available projects in the README for main sample project.
  5. delete pom.xml file

Copy link

@cppwfs cppwfs left a comment

Choose a reason for hiding this comment

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

Thank you for creating a new PR for this sample. It is much appreciated.

Currently the test fails because you are mixing Junit4 and Junit5. In the comments below we have made recommendations on how to handle this properly.

@@ -0,0 +1,24 @@
<configuration>
Copy link

Choose a reason for hiding this comment

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

Why are you using the logback configuration here?

Copy link
Author

Choose a reason for hiding this comment

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

@cppwfs Is it better to delete the logback configuration?

Copy link

Choose a reason for hiding this comment

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

It can be removed unless there is a particular reason it is needed.

* @since 5.2
*
*/
public class BrokerRunning extends TestWatcher {
Copy link

Choose a reason for hiding this comment

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

Please remove BrokerRunning as the method for testing the MQTT5 app. Please use the Mosquitto test container as shown here: https://github.com/spring-projects/spring-integration/blob/main/spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/MqttDslTests.java

@Bean
public MqttConnectionOptions mqttConnectionOptions() {
MqttConnectionOptions options = new MqttConnectionOptions();
options.setServerURIs(new String[]{ "tcp://localhost:1883" });
Copy link

Choose a reason for hiding this comment

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

You will need expose host and port with either ConfigurationProperties or SystemProperties instead of the hardcoded value. Especially when using test container because they use dynamic properties to establish ports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants