I am new to Autobahn and crossbar.io. So far, I try to make an onEvent
function which could be used in subscribing different topics at the same time. However, I need this function to know which message comes from which topic. Then, I find there is a details
argument in subscibe
function, which contains a topic
parameter. However, when receiving messages, this parameter always shows None
. Could any one tell me how to do proper settings? Is this possible to be done in both Autobahn|JS and Autobahn|Python?
(In my scenario, I use exact-match-uri-method to subscribe several topics. Hope methods provided by anyone could work under this condition)
Thanks
This is not a matter of settings. Crossbar.io only sends the subscription topic over the wire in case of pattern-based subscriptions. Otherwise the knowledge of the the subscription topic is already in the client. The Autobahn libraries currently provide the event details as they come over the wire - and so you don't get the subscription topic for exact matching subscriptions.
Having another look at this this is unexpected behavior. Since there's really no good reason not to provide the subscription topic irrespective of the kind of subscription, we'll change this. There's already a change in Autobahn|JS, and it'll be in the next release there (if you build from trunk on GitHub you can use it now), and there's an issue opened for Autobahn|Python.