Skip to content

Fix shared subscription listener matching for MQTT#2236

Merged
jeremydmiller merged 1 commit intomainfrom
GH2213
Feb 24, 2026
Merged

Fix shared subscription listener matching for MQTT#2236
jeremydmiller merged 1 commit intomainfrom
GH2213

Conversation

@jeremydmiller
Copy link
Copy Markdown
Member

Summary

  • Fixes Issues with "SharedGroupName" option in "ListenToMqttTopic" #2213: MqttListener.TopicName was set to the full shared subscription string (e.g. $share/group/topic), but the MQTT broker delivers messages with the actual topic name (without $share/ prefix). tryFindListener couldn't match incoming messages because MqttTopicFilterComparer doesn't understand the $share/ prefix format.
  • Changed MqttListener to use topic.ListeningTopic (which strips the $share/group/ prefix) instead of topic.TopicName, so incoming messages match correctly against the listener's topic filter.
  • Added Mosquitto Docker container for integration testing and compliance tests including shared subscription tests with specific and wildcard topics.

Test plan

  • Shared subscription with specific topic passes against real Mosquitto broker
  • Shared subscription with wildcard (incoming/+) topic passes against real Mosquitto broker
  • Full Mosquitto buffered compliance suite (16/18 pass; 2 failures are pre-existing compliance suite incompatibilities unrelated to shared subscriptions)
  • All existing MQTT tests pass (pre-existing EMQX test failure unaffected)

🤖 Generated with Claude Code

MqttListener.TopicName was set to the full subscription string (e.g.
$share/group/topic) but incoming messages arrive with the actual topic
name. Changed to use ListeningTopic which strips the $share prefix,
allowing MqttTopicFilterComparer to match correctly.

Added Mosquitto Docker container and compliance tests including shared
subscription tests with specific and wildcard topics.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

Issues with "SharedGroupName" option in "ListenToMqttTopic"

1 participant