2 Replies Latest reply on Apr 21, 2017 9:35 AM by mneumann RSS
    stefanbod Apprentice

    How to get access to the MQTT topic of a message received in ThingWorx.

    Hi gents,

     

    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

     

    Problem:

    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?

     

    Thx

      • Re: How to get access to the MQTT topic of a message received in ThingWorx.
        supandey Collaborator

        Stefan I believe currently we have a Jira going on this for enhancement due to the MQTT Extension in ThingWorx not supporting the wildcard subscriptions

        • Re: How to get access to the MQTT topic of a message received in ThingWorx.
          mneumann Creator

          Hi Stefan,

          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):

          1. map each and every full topic name to a TWX property, which is painful when having a lot of topics
          2. 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

           

          /Michael

           

          ---

           

          Enhancement Request JIRA is PSPT-3613