Unable to trigger flow from MQTT topic

I am trying to test triggering a flow from a MQTT topic, trying to start out simple by getting the message and logging it, but it isn't working.

I have a MQTT broker installed using docker exposing out to my local machine.  I have a publisher that is simply dumping a counter and timestamp in to the topic and I have multiple testing subscribers all looking at it, both from within docker, and running on my localhost, so I am confident that the MQTT portion is working correctly.

I have a feeling that I'm missing something fairly straight forward in the flow setup.

Below is my flow json.

Thank you.

{
  "name": "mqttTesting",
  "type": "flogo:app",
  "version": "0.0.1",
  "appModel": "1.0.0",
  "triggers": [
    {
      "id": "receive_mqtt_message",
      "ref": "github.com/TIBCOSoftware/flogo-contrib/trigger/mqtt",
      "name": "Receive MQTT Message",
      "description": "Simple MQTT Trigger",
      "settings": {
        "broker": "tcp://127.0.0.1:1883",
        "id": "",
        "user": "",
        "password": "",
        "store": "",
        "topic": null,
        "qos": "0",
        "cleansess": false
      },
      "handlers": [
        {
          "action": {
            "ref": "github.com/TIBCOSoftware/flogo-contrib/action/flow",
            "data": {
              "flowURI": "res://flow:mqtt_tester"
            }
          },
          "settings": {
            "topic": "hello"
          }
        }
      ]
    }
  ],
  "resources": [
    {
      "id": "flow:mqtt_tester",
      "data": {
        "name": "mqttTester",
        "description": "testing reading a mqtt mesage",
        "metadata": {
          "input": [
            {
              "name": "message",
              "type": "string"
            }
          ]
        },
        "tasks": [
          {
            "id": "log_2",
            "name": "Log Message",
            "description": "Simple Log Activity",
            "activity": {
              "ref": "github.com/TIBCOSoftware/flogo-contrib/activity/log",
              "input": {
                "message": "",
                "flowInfo": "true",
                "addToFlow": "false"
              },
              "mappings": {
                "input": [
                  {
                    "type": "assign",
                    "value": "$flow.message",
                    "mapTo": "message"
                  },
                  {
                    "type": "expression",
                    "value": "string.concat(\"Hello\", $flow.message)",
                    "mapTo": "addToFlow"
                  }
                ]
              }
            }
          }
        ],
        "errorHandler": {
          "tasks": [
            {
              "id": "log_3",
              "name": "Log Message (2)",
              "description": "Simple Log Activity",
              "activity": {
                "ref": "github.com/TIBCOSoftware/flogo-contrib/activity/log",
                "input": {
                  "message": "",
                  "flowInfo": "false",
                  "addToFlow": "false"
                }
              }
            }
          ]
        }
      }
    }
  ]
}

 

(1) Answer

Login