Skip to content

Shared subscription prefix "$SharedSubscription" not supported #10853

@michelblk

Description

@michelblk

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:

|| 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

  1. Use an MQTT broker that requires the "$SharedSubscription" prefix for shared subscriptions (e.g. IBM MessageSight).
  2. Configure spring-integration-mqtt to subscribe to "$SharedSubscription/prod/myTopic".
  3. Send a message to "myTopic".
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions