How to get access to the MQTT topic of a message received in ThingWorx.
the ThingWorx startup behavior in not as expected when many things are connected to an MQTT broker (Subscribing process for each thing takes ages). Therefore I want to connect one thing and distribute the messages to the things that should receive it.
Defining the Subscriber is fine: /hm/status/# into VALUE: MyMessage
I have no access to the complete topic. I only get the messages. For proper operation, I need the full topic path that comes with the message. Is there a way to use wildcards and get the full topic somewhere in ThingWorx?
Re: How to get access to the MQTT topic of a message received in ThingWorx.
do you get the messages for subscribing to the wildcard topic?
For me I only get messages for a fully defined topic - the missing wildcard subscriptions are what Sushant mentioned with this enhancement request.
Getting the full topic seems not to be part of the MQTT extension functionality.
I'll open an enhancement request for that as well.
As for now, the only two things that come to mind are (based on you only want to use one MQTT thing instead of many):
map each and every full topic name to a TWX property, which is painful when having a lot of topics
send the device-id as part of a JSON and use the JSON to fire events / run services once a new value is received, which is problematic in a sense that you will need to update all of the devices to include the device id
I've checked with MQTT.fx and for subscriptions it actually shows the (wildcard) topic you're subscribed to as well as the full topic, that the specific message is coming in. In addition to being able to subscribe to wildcard topics, there's also a requirement / enhancement for reading the full topic...
Not sure if it helps,
but that's all I have for now
Enhancement Request JIRA is PSPT-3613
Thingworx Navigate content has a new home! Click here to access the new Thingworx Navigate forum!