When the gateway receives a SUBSCRIBE for a topic containing wildcards, it responds with a SUBACK containing a non-zero topic ID. The specification states (Section 5.4.16, pages 15-16):
TopicId: in case of “accepted” the value that will be used as topic id by the gateway when sending PUBLISH
messages to the client (not relevant in case of subscriptions to a short topic name or to a topic name which
contains wildcard characters)
Since this is a waste of a topic ID, imho it would be preferable to set the topic IDs of wildcard topics to zero.
Edit: Actually found a more explicit statement in the specification (page 23):
If the client subscribes to a topic name which contains a wildcard character, the returning SUBACK message will contain the topic id value 0x0000.
When I am subscribing to a wildcard topic, I get the SUBACK back with topic-id == 0x00;
However, I am also getting the msg-id == 0x00, is that correct?
When the gateway receives a SUBSCRIBE for a topic containing wildcards, it responds with a SUBACK containing a non-zero topic ID. The specification states (Section 5.4.16, pages 15-16):
Since this is a waste of a topic ID, imho it would be preferable to set the topic IDs of wildcard topics to zero.
Edit: Actually found a more explicit statement in the specification (page 23):