Skip to content

GH-3697: Various lifecycle fixed for MQTT v5 CAs #3698

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

Merged
merged 1 commit into from
Dec 16, 2021

Conversation

artembilan
Copy link
Member

Fixes #3697
SO: https://stackoverflow.com/questions/70374046/spring-integration-mqtt-failed-to-start-app-when-the-network-is-disconnected

  • Add mqttClient.disconnect() to Mqttv5PahoMessageDrivenChannelAdapter.doStop() - the doStart() does connect()
  • Add Mqttv5PahoMessageDrivenChannelAdapter.destroy() impl to close mqttClient
  • Fix Mqttv5PahoMessageHandler.doStart() to not re-throw an exception on connection.
    Emit an MqttConnectionFailedEvent and log error instead
  • Fix Mqttv5PahoMessageHandler.destroy() to call mqttClient.close(true) for better resources clean up
  • Improve MQTT v5 components Javadocs and add a reconnect note into mqtt.adoc

Fixes spring-projects#3697
SO: https://stackoverflow.com/questions/70374046/spring-integration-mqtt-failed-to-start-app-when-the-network-is-disconnected

* Add `mqttClient.disconnect()` to `Mqttv5PahoMessageDrivenChannelAdapter.doStop()` - the `doStart()` does `connect()`
* Add `Mqttv5PahoMessageDrivenChannelAdapter.destroy()` impl to close `mqttClient`
* Fix `Mqttv5PahoMessageHandler.doStart()` to not re-throw an exception on connection.
Emit an `MqttConnectionFailedEvent` and log error instead
* Fix `Mqttv5PahoMessageHandler.destroy()` to call `mqttClient.close(true)` for better resources clean up
* Improve MQTT v5 components Javadocs and add a reconnect note into `mqtt.adoc`
@garyrussell garyrussell merged commit 8c57cb7 into spring-projects:main Dec 16, 2021
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.

Incomplete shutdown of Mqttv5PahoMessageDrivenChannelAdapter
2 participants