Skip to content

spring-integration-mqtt: Any plan to integrate with org.eclipse.paho.mqttv5.client #3432

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

Closed
UpCareer opened this issue Nov 21, 2020 · 8 comments · Fixed by #3639
Closed

spring-integration-mqtt: Any plan to integrate with org.eclipse.paho.mqttv5.client #3432

UpCareer opened this issue Nov 21, 2020 · 8 comments · Fixed by #3639

Comments

@UpCareer
Copy link

UpCareer commented Nov 21, 2020

Expected Behavior

Spring-integration-mqtt supports mqtt protocol version 5. (Currently, it only support mqtt protocol version 3)

Current Behavior

Latest spring-integration-mqtt still support mqtt version 3 by integrating with

<dependency>
<groupId>org.eclipse.paho</groupId>
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
<version>1.2.4</version>
<scope>compile</scope>
</dependency>

We have a project which requires a Spring Boot app integrate with mqttv5 client.

        <dependency>
            <groupId>org.eclipse.paho</groupId>
            <artifactId>org.eclipse.paho.mqttv5.client</artifactId>
            <version>1.2.5</version>
        </dependency>

I would like to check if we have the plan to have new release of spring-integration-mqtt which is able to support mqtt version 5.

How has this issue affected you? our team will develop a springboot app which need to support mqtt version 5. However, the current spring-integration-mqtt dependency only support mqtt version 3.
What are you trying to accomplish? We would like to have a new release of spring-integration-mqtt which is able to support mqtt version 5.
What other alternatives have you considered?
Are you aware of any workarounds? I have two thoughts: 1. Write a full functional mqtt version 5 client, but it need to handle all connect, reconnect, disconnet and other features. 2. Write a simplified spring-integration-mqtt dependency which integrate with org.eclipse.paho.mqttv5.client

I am looking forward to hearing from spring team soon.

Thanks

@UpCareer UpCareer added status: waiting-for-triage The issue need to be evaluated and its future decided type: enhancement labels Nov 21, 2020
@artembilan
Copy link
Member

Hi @UpCareer !

We have those plans, indeed. See #3102.

The long term is indeed to move to Hive library with its reactive support.
However with the org.eclipse.paho.mqttv5.client artifact we may consider to extend existing functionality for MQTT v5 sooner than later.

If you have any ideas in mind how to implement the AbstractMqttMessageDrivenChannelAdapter and AbstractMqttMessageHandler for org.eclipse.paho.mqttv5.client, I'd be glad to review your contribution and probably have it merged into the current 5.4.x version rather than wait until the next 5.5 or 6.0 release.

@artembilan artembilan added this to the Backlog milestone Nov 23, 2020
@artembilan artembilan mentioned this issue Mar 22, 2021
@Whisper40
Copy link

Whisper40 commented Apr 25, 2021

Hello ! Is there news for MqttV5 ? (I need to create groups for multiple pods)

@artembilan
Copy link
Member

Hi @Whisper40 !

Thank you for an interest in the feature for this project!

Unfortunately we didn't have a chance to look into this recently.

The contribution is welcome: https://github.com/spring-projects/spring-integration/blob/main/CONTRIBUTING.adoc

@Whisper40
Copy link

@artembilan Hi, sry i'm not a java dev :( This is a really old feature, because mqtt 5 is there for a long time now :)

@smpshehan
Copy link

Does Spring boot support MQTT V5 yet or not? I assume not by reading this thread :-(

@artembilan
Copy link
Member

We definitely have those plans for next 6.0 version, but since it has got enough community attention, I'm going to investigate it ASAP, so we could implement it and release quickly after we start that version.

@artembilan
Copy link
Member

@artembilan artembilan self-assigned this Sep 29, 2021
artembilan added a commit to artembilan/spring-integration that referenced this issue Oct 4, 2021
Fixes spring-projects#3432

* Add `optional` dependency for `org.eclipse.paho:org.eclipse.paho.mqttv5.client`
* Add `MqttProtocolErrorEvent` and emit it from the `mqttErrorOccurred()` callback of the MQTT v5 client
* Add `MqttHeaderMapper` since MQTT v5 has introduced user properties pair to transfer over the protocol
* Add `Mqttv5PahoMessageHandler` as one more extension of the `AbstractMqttMessageHandler`
* Add more convenient `MqttHeaders` constants for easier headers mapping configuration
* Ensure via `Mqttv5BackToBackTests` that MQTT v5 is supported by the provided components
* Change `pr-build-workflow.yml` to use `eclipse-mosquitto` container for testing all the MQTT interactions
* Change `cyrilix/rabbitmq-mqtt` service to the `rabbitmq:management` since RabbitMQ does not support MQTT v5
@artembilan
Copy link
Member

FYI: #3639

If that goes OK with review, we will have some MQTT v5 support in the upcoming 5.5.5 release in a couple weeks.

Thanks.

@artembilan artembilan removed the status: waiting-for-triage The issue need to be evaluated and its future decided label Oct 5, 2021
@artembilan artembilan modified the milestones: Backlog, 5.5.5 Oct 5, 2021
garyrussell added a commit that referenced this issue Oct 6, 2021
* GH-3432: Add MQTT v5 channel adapters

Fixes #3432

* Add `optional` dependency for `org.eclipse.paho:org.eclipse.paho.mqttv5.client`
* Add `MqttProtocolErrorEvent` and emit it from the `mqttErrorOccurred()` callback of the MQTT v5 client
* Add `MqttHeaderMapper` since MQTT v5 has introduced user properties pair to transfer over the protocol
* Add `Mqttv5PahoMessageHandler` as one more extension of the `AbstractMqttMessageHandler`
* Add more convenient `MqttHeaders` constants for easier headers mapping configuration
* Ensure via `Mqttv5BackToBackTests` that MQTT v5 is supported by the provided components
* Change `pr-build-workflow.yml` to use `eclipse-mosquitto` container for testing all the MQTT interactions
* Change `cyrilix/rabbitmq-mqtt` service to the `rabbitmq:management` since RabbitMQ does not support MQTT v5

* * Handle manual acks
* Add `Mqttv5PahoMessageDrivenChannelAdapter.persistence` property

* * Add documentation
* Add `MosquittoContainerTest` for TestContainers support with Mosquitto image

* Fix language in the docs after review

Co-authored-by: Gary Russell <[email protected]>

Co-authored-by: Gary Russell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants