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 MqttMessageDeliveredEvent not publish #9428

Closed
JupiterMx opened this issue Aug 29, 2024 · 1 comment · Fixed by #9435
Closed

MQTT MqttMessageDeliveredEvent not publish #9428

JupiterMx opened this issue Aug 29, 2024 · 1 comment · Fixed by #9435
Assignees
Milestone

Comments

@JupiterMx
Copy link

In what version(s) of Spring Integration are you seeing this issue?

6.3.3

Describe the bug

When integrating MQTT using the Shared MQTT Client Support method, the MqttMessageDeliveredEvent event will not be published.
Because the MQTT client's callback is no longer MqttPahoMessageHandler, the MqttMessageDeliveredEvent event is no longer triggered for publication.

image

@JupiterMx JupiterMx added status: waiting-for-triage The issue need to be evaluated and its future decided type: bug labels Aug 29, 2024
@artembilan artembilan added in: mqtt and removed status: waiting-for-triage The issue need to be evaluated and its future decided labels Aug 30, 2024
@artembilan artembilan added this to the 6.4.0-M3 milestone Aug 30, 2024
@artembilan
Copy link
Member

Thank you for the report!
Yeah, I see the pain and how it may cause problems.
Even if I accept it, I'll still consider it to be fixed only for the current 6.4 version.
Apparently the fix is a bit involved and we know that there is a workaround like relying on the internal client for the MqttPahoMessageHandler.

@artembilan artembilan self-assigned this Aug 30, 2024
artembilan added a commit to artembilan/spring-integration that referenced this issue Aug 30, 2024
…t instance

Fixes: spring-projects#9428

Issue link: spring-projects#9428

When `ClientManager` is used for MQTT channel adapters, a `MqttMessageDeliveredEvent`
is not emitted since callback for the `ClientManager` is not aware about `deliveryComplete`

* Use a `MqttActionListener` abstraction for the `publish` operation instead of a `deliveryComplete`
from a common callback
* Make some other refactoring into the `MqttPahoMessageHandler` and `Mqttv5PahoMessageHandler`
extracting a common logic into their `AbstractMqttMessageHandler` superclass
* Introduce an `MqttMessageNotDeliveredEvent` to be emitted from the `MqttActionListener.onFailure()` callback
* Adapt mocks in the `MqttAdapterTests` for a new code flow
* Add delivery events verification into the `ClientManagerBackToBackTests`
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.

2 participants