Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix mqtt trigger #17

Closed

Conversation

skothari-tibco
Copy link
Contributor

@skothari-tibco skothari-tibco commented Jan 28, 2020

Fixes #16

@fm-tibco
Copy link

Seems to work as is before this PR. I start a mosquitto server, and publish to multiple handlers several times and it works.

mosquitto_pub -t flogo -m 1
mosquitto_pub -t flogo -m 1
mosquitto_pub -t flogo -m 1
mosquitto_pub -t flogo2 -m 2
mosquitto_pub -t flogo2 -m 2

flogo.json

{
  "name": "testapp",
  "type": "flogo:app",
  "version": "0.0.1",
  "description": "",
  "appModel": "1.1.0",
  "imports": [
    "github.com/project-flogo/flow",
    "github.com/project-flogo/edge-contrib/trigger/mqtt",
    "github.com/project-flogo/contrib/activity/log"
  ],
  "triggers": [
    {
      "id": "mqtt-trigger",
      "name": "Mqtt Trigger",
      "ref": "#mqtt",
      "settings": {
        "broker" : "tcp://localhost:1883",
        "id":"client-1"
      },
      "handlers": [
        {
          "settings": {
            "topic": "flogo",
            "qos": "0"
          },
          "action": {
            "ref": "#flow",
            "settings": {
              "flowURI": "res://flow:log"
            },
            "input": {
              "in" : "1"
            }
          }
        },
        {
          "settings": {
            "topic": "flogo2",
            "qos": "0"
          },
          "action": {
            "ref": "github.com/project-flogo/flow",
            "settings": {
              "flowURI": "res://flow:log"
            },
            "input": {
              "in" : "2"
            }
          }
        }
      ]
    }
  ],
  "resources": [
    {
      "id": "flow:log",
      "data": {
        "name": "simpleflow",
        "metadata": {
          "input": [
            {
              "name": "in",
              "type": "string"
            }
          ]
        },
        "tasks": [
          {
            "id": "log_1",
            "name": "Log 1",
            "activity": {
              "ref": "#log",
              "input": {
                "message": "=$flow.in"
              }
            }
          }
        ]
      }
    }
  ]
}

@skothari-tibco skothari-tibco deleted the fix-mqtt-trigger branch January 29, 2020 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MQTT activity has uncaught empty result
2 participants