[
https://issues.apache.org/jira/browse/AMQ-5061?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13904161#comment-13904161
]
Roger Light commented on AMQ-5061:
----------------------------------
The assumption is incorrect I'm afraid.
foo/bar and /foo/bar are distinct topic names. It is easiest to reconcile what
is happening if you imagine that the topics are foo/bar and ""/foo/bar - i.e.
there is an empty hierarchy element at the beginning. This is consistent with
the expectation that foo/bar and foo//bar are distinct topics. Again, think of
this as like foo/""/bar with a zero length hierarchy element in the middle.
This also influences the way wildcards work. Subscribing to a topic # returns
messages from both foo/bar and /foo/bar, but subscribing to /# would only
return messages from /foo/bar. Likewise a subscription to +/foo/bar would
return messages from /foo/bar because + matches against the empty hierarchy
element.
> MQTT Hierarchical Destination names may start with a leading '/', which must
> be ignored when mapping to ActiveMQ destination name
> ---------------------------------------------------------------------------------------------------------------------------------
>
> Key: AMQ-5061
> URL: https://issues.apache.org/jira/browse/AMQ-5061
> Project: ActiveMQ
> Issue Type: Bug
> Components: MQTT
> Affects Versions: 5.9.0
> Reporter: Dhiraj Bokde
> Fix For: 5.10.0
>
> Attachments: AMQ-5061.patch
>
>
> MQTT hierarchical destination names use the '/' character to separate levels.
> The name may start with a '/', which indicates root level, so it must be
> ignored when mapping to ActiveMQ destination names. This is required so that
> both 'TopicA' and '/TopicA' map to the same ActiveMQ destination name
> 'TopicA'.
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)