GH-10853: Fix MQTTv5 for any shared subscription pattern#10856
Merged
cppwfs merged 4 commits intospring-projects:mainfrom Mar 16, 2026
Merged
GH-10853: Fix MQTTv5 for any shared subscription pattern#10856cppwfs merged 4 commits intospring-projects:mainfrom
cppwfs merged 4 commits intospring-projects:mainfrom
Conversation
Fixes: spring-projects#10853 Apparently, not all MQTT brokers come with `$share/` pattern on shared subscription topics. * Fix `Mqttv5PahoMessageDrivenChannelAdapter` to check `subscribedTopic` for starting `$` symbol and having `/` * Adjust `ClientManagerBackToBackTests.sharedTopicWithClientManager()` for IBM MessageSight and Eclipse Amlen pattern with `$SharedSubscription/` **Auto-cherry-pick to `7.0.x` & `6.5.x`**
Apparently, Mosquitto broker does not support anything else.
* Populate a dedicated map of the configured topics and their counterpart without shared subscription pattern * Have patter against standard `$share/` prefix and possible `$SharedSubscription/` in some other brokers
Member
Author
|
@mrpiggi , I have pushed some flexible fix we all are worried about. We are planning to release next week. Thanks |
cppwfs
requested changes
Mar 13, 2026
Contributor
cppwfs
left a comment
There was a problem hiding this comment.
Awesome!
A couple of small questions.
Do we want to put this in the "whats-new" since we are supporting both share and SharedSubscription ?
* Rename vararg `topic` to `topics` in the `Mqttv5PahoMessageDrivenChannelAdapter.removeTopic()`
cppwfs
approved these changes
Mar 16, 2026
Contributor
cppwfs
left a comment
There was a problem hiding this comment.
Love it!
Thanks for the changes
LGTM
spring-builds
pushed a commit
that referenced
this pull request
Mar 16, 2026
* GH-10853: Fix MQTTv5 for any shared subscription pattern Fixes: #10853 Apparently, not all MQTT brokers come with `$share/` pattern on shared subscription topics. * Fix `Mqttv5PahoMessageDrivenChannelAdapter` to check `subscribedTopic` for starting `$` symbol and having `/` * Adjust `ClientManagerBackToBackTests.sharedTopicWithClientManager()` for IBM MessageSight and Eclipse Amlen pattern with `$SharedSubscription/` * Bring back `$share/` for `ClientManagerBackToBackTests`. Apparently, Mosquitto broker does not support anything else. * Use regexp for shared subscription patterns * Populate a dedicated map of the configured topics and their counterpart without shared subscription pattern * Have patter against standard `$share/` prefix and possible `$SharedSubscription/` in some other brokers * Add mock test to verify different topics population * Rename vararg `topic` to `topics` in the `Mqttv5PahoMessageDrivenChannelAdapter.removeTopic()` (cherry picked from commit b3355e4)
cppwfs
pushed a commit
that referenced
this pull request
Mar 16, 2026
* GH-10853: Fix MQTTv5 for any shared subscription pattern Fixes: #10853 Apparently, not all MQTT brokers come with `$share/` pattern on shared subscription topics. * Fix `Mqttv5PahoMessageDrivenChannelAdapter` to check `subscribedTopic` for starting `$` symbol and having `/` * Adjust `ClientManagerBackToBackTests.sharedTopicWithClientManager()` for IBM MessageSight and Eclipse Amlen pattern with `$SharedSubscription/` **Auto-cherry-pick to `7.0.x` & `6.5.x`** * Bring back `$share/` for `ClientManagerBackToBackTests`. Apparently, Mosquitto broker does not support anything else. * Use regexp for shared subscription patterns * Populate a dedicated map of the configured topics and their counterpart without shared subscription pattern * Have patter against standard `$share/` prefix and possible `$SharedSubscription/` in some other brokers * Add mock test to verify different topics population * Rename vararg `topic` to `topics` in the `Mqttv5PahoMessageDrivenChannelAdapter.removeTopic()`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: #10853
Apparently, not all MQTT brokers come with
$share/pattern on shared subscription topics.Mqttv5PahoMessageDrivenChannelAdapterto checksubscribedTopicfor starting$symbol and having/ClientManagerBackToBackTests.sharedTopicWithClientManager()for IBM MessageSight and Eclipse Amlen pattern with$SharedSubscription/Auto-cherry-pick to
7.0.x&6.5.x