-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
In what version(s) of Spring Integration are you seeing this issue?
Since version 6.5.6
Describe the bug
We use the mqtt topic prefix "$SharedSubscription" instead of the default prefix "$share" to use to mqtt shared subscription feature.
Since version 6.5.6 of spring-integration-mqtt, all MQTTv5 messages are ignored when the "$SharedSubscription" prefix is used. The topics of incoming messages do not match any subscribed topics, so no messages are processed.
The relevant code appears to be:
Line 444 in 79f6938
| || subscribedTopic.startsWith("$share/") && subscribedTopic.endsWith(receivedTopic)) { |
The topic prefix for shared subscriptions is currently not configurable. This leads to incompatibility with brokers like IBM MessageSight, which require "$SharedSubscription".
To Reproduce
- Use an MQTT broker that requires the "$SharedSubscription" prefix for shared subscriptions (e.g. IBM MessageSight).
- Configure spring-integration-mqtt to subscribe to "$SharedSubscription/prod/myTopic".
- Send a message to "myTopic".
- The callback function is not triggered because the topic is not recognized.
Expected behavior
The callback function should be triggered when a message arrives on the topic "myTopic"—regardless of whether the prefix is "$share" or "$SharedSubscription". The topic prefix should be configurable.
Sample