Skip to content

GH-11538: Deprecate the Paho-based MQTT module - #11554

Open
PHJ2000 wants to merge 2 commits into
spring-projects:mainfrom
PHJ2000:GH-11538
Open

PHJ2000 wants to merge 2 commits into
spring-projects:mainfrom
PHJ2000:GH-11538

Conversation

@PHJ2000

@PHJ2000 PHJ2000 commented Oct 17, 2026

Copy link
Copy Markdown

Deprecate the Paho-based spring-integration-mqtt types for removal as of 7.2 in favor of the HiveMQ-based spring-integration-mqtt-client module. Update the MQTT reference and What's New with the deprecation and migration direction. No runtime logic is changed.

Fixes #11538.

Validation

  • :spring-integration-mqtt:check api antora: passed after updating the branch to main at 6a037f85a8 (50 MQTT tests passed, zero failures/skips; Checkstyle, API docs, and reference docs passed; JDK 25 and Docker).
  • The full test suite has not completed successfully locally. JDBC testing on unmodified main also exhibits repeated MySqlTxTimeoutMessageStoreTests.concurrentPolling timeouts, reported in MySqlTxTimeoutMessageStoreTests.concurrentPolling repeatedly times out during JDBC module tests #11553. In a separate observation, two attempts reached the existing 10-minute JUnit timeout and advanced to retries; the run was stopped by my 30-minute observation limit before all retries completed. This is not a claim of a permanent hang or a final suite failure.

Proposed migration guide note

The wiki is maintained separately from this repository. Could the following note be included in the 7.1-to-7.2 migration guide?

Paho-based MQTT support

The spring-integration-mqtt module and its types are deprecated for removal in Spring Integration 7.2.
Use the spring-integration-mqtt-client module, which is based on the HiveMQ MQTT client, for new MQTT integrations.

When migrating an existing integration, replace the org.springframework.integration:spring-integration-mqtt dependency with org.springframework.integration:spring-integration-mqtt-client.
Update the Spring Integration MQTT components to use the org.springframework.integration.mqtt.client packages and adapt client configuration to the HiveMQ API.
For example, the new module provides Mqtt3ClientManager and Mqtt5ClientManager instead of Mqttv3ClientManager and Mqttv5ClientManager, and Mqtt3MessageDrivenChannelAdapter and Mqtt5MessageDrivenChannelAdapter for inbound adapters.
Paho connection options and callback implementations need to be adapted to the corresponding HiveMQ APIs.

The deprecated module remains available in 7.2.

Fixes: spring-projects#11538

The HiveMQ-based spring-integration-mqtt-client module provides the
replacement for the Paho-based MQTT integration.

* Deprecate the existing module types for removal as of 7.2.
* Explain the replacement in the MQTT reference and What's New.

Signed-off-by: Jaehong Park <105151063+PHJ2000@users.noreply.github.com>
@artembilan

Copy link
Copy Markdown
Member

@artembilan artembilan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you!

A little inconvenience, though.
Now we got a gazillion of removal warnings in our build logs.
Please, go over all the classes in the module (including tests) and add a @SuppressWarnings("removal"), too.
This will mitigate build noise on the matter and won't cause a situation that some other problem would slip from us.

* @see org.eclipse.paho.client.mqttv3.MqttCallbackExtended#connectComplete
* @deprecated since 7.2 in favor of the {@code spring-integration-mqtt-client} module.
*/
@Deprecated(since = "7.2", forRemoval = true)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think it makes sense to put such an annotation on all the inner types.
I believe just top-level class is enough.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Removed the redundant @Deprecated annotations and @deprecated Javadoc tags from ConnectCallback, DefaultMessageHandler, and Will in 02b7ee2. Deprecation is now declared only on the enclosing top-level types.

Suppress removal warnings on top-level production and test types so
internal uses of the deprecated API do not obscure other build warnings.
Remove redundant deprecation declarations from nested types; retain
deprecation on their enclosing top-level types.

Signed-off-by: Jaehong Park <105151063+PHJ2000@users.noreply.github.com>
@PHJ2000

PHJ2000 commented Oct 20, 2026

Copy link
Copy Markdown
Author

Addressed in 02b7ee2.

Added @SuppressWarnings("removal") to all top-level types in the module, including test classes, while preserving existing warning suppressions. Removed the redundant deprecation annotations and Javadoc tags from nested types, as noted in the inline thread.

Validation: :spring-integration-mqtt:check api with --no-build-cache passed on JDK 25. All 50 MQTT tests passed with no failures or skips; Checkstyle and API documentation generation passed, and the build log contains no removal warnings. The full project test suite was not rerun for this annotation-only follow-up.

Thank you for adding the migration guide note.

This branch has not been deployed

No deployments
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.

Deprecate spring-integration-mqtt

2 participants