Skip to content

GH-9428: Emit MQTT delivery events even if share client instance #9435

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 2 commits into from
Sep 4, 2024

Conversation

artembilan
Copy link
Member

Fixes: #9428

Issue link: #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

…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`
@artembilan artembilan requested a review from sobychacko August 30, 2024 17:59
Looks like the message can be consumed even before we just emit that `MqttMessageSentEvent`
@artembilan artembilan merged commit e9a577d into spring-projects:main Sep 4, 2024
3 checks passed
@artembilan artembilan deleted the GH-9428 branch September 4, 2024 19:49
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.

MQTT MqttMessageDeliveredEvent not publish
2 participants