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

MQTT activity has uncaught empty result #16

Open
dcsouthwick opened this issue Jan 28, 2020 · 2 comments
Open

MQTT activity has uncaught empty result #16

dcsouthwick opened this issue Jan 28, 2020 · 2 comments

Comments

@dcsouthwick
Copy link

dcsouthwick commented Jan 28, 2020

Trying to publish messages with MQTT activity hangs after the first completion.

2020-01-28T16:54:20.010+0100	DEBUG	[flogo.activity.mqtt] -	Applying InputMapper
2020-01-28T16:54:20.010+0100	DEBUG	[flogo.activity.mqtt] -	Published Message: {"message":"Hello World"}
2020-01-28T16:54:20.010+0100	DEBUG	[flogo.activity.mqtt] -	Applying OutputMapper
2020-01-28T16:54:20.010+0100	DEBUG	[flogo.flow] -	Task 'mqtt_3' is done
2020-01-28T16:54:20.010+0100	DEBUG	[flogo.flow] -	Notifying flow that end task 'mqtt_3' is done
2020-01-28T16:54:20.010+0100	DEBUG	[flogo.flow] -	Checking if all tasks done or skipped
2020-01-28T16:54:20.010+0100	DEBUG	[flogo.flow] -	All tasks done or skipped
2020-01-28T16:54:20.010+0100	DEBUG	[flogo.flow] -	Flow Done
2020-01-28T16:54:20.010+0100	DEBUG	[flogo.flow] -	Done Executing flow instance [a008dc42525a066c4a0785dba93a6109] - Status: 500
2020-01-28T16:54:20.010+0100	INFO	[flogo.flow] -	Instance [a008dc42525a066c4a0785dba93a6109] Done
2020-01-28T16:54:20.010+0100	DEBUG	[flogo] -	Action-Worker-1: Received result: &runner.ActionResult{results:map[string]interface {}{}, err:error(nil)}
2020-01-28T16:54:20.010+0100	DEBUG	[flogo] -	Action-Worker-1: Completed Request
2020-01-28T16:54:20.010+0100	DEBUG	[flogo] -	Action 'github.com/project-flogo/flow' returned

Example Flow:

{
  "name": "Edge",
  "type": "flogo:app",
  "version": "0.0.1",
  "appModel": "1.1.0",
  "description": "Edge Metrics MQTT",
  "imports": [
    "github.com/project-flogo/contrib/activity/log",
    "github.com/project-flogo/edge-contrib/trigger/mqtt",
    "github.com/project-flogo/flow",
    "mqtt_1 github.com/project-flogo/edge-contrib/activity/mqtt"
  ],
  "triggers": [
    {
      "id": "receive_mqtt_message",
      "ref": "#mqtt",
      "name": "Receive MQTT Message",
      "description": "Simple MQTT Trigger",
      "settings": {
        "broker": "tcp://localhost:1883",
        "id": "mqtt_subscribe",
        "cleanSession": true
      },
      "handlers": [
        {
          "settings": {
            "topic": "test",
            "qos": 0
          },
          "action": {
            "ref": "#flow",
            "settings": {
              "flowURI": "res://flow:mqtt"
            },
            "input": {
              "message": "=$.message"
            }
          }
        }
      ]
    }
  ],
  "resources": [
    {
      "id": "flow:mqtt",
      "data": {
        "name": "MQTT",
        "description": "Reads MQTT device readings, and publishes to cloud VIA MQTT",
        "metadata": {
          "input": [
            {
              "name": "message",
              "type": "string"
            }
          ]
        },
        "tasks": [
          {
            "id": "log_2",
            "name": "Log",
            "description": "Logs a message",
            "activity": {
              "ref": "#log",
              "input": {
                "message": "=$flow.message",
                "addDetails": true
              }
            }
          },
          {
            "id": "mqtt_3",
            "name": "MQTT Activity",
            "description": "Send MQTT message",
            "activity": {
              "ref": "#mqtt_1",
              "input": {
                "message": "=$flow.message"
              },
              "settings": {
                "broker": "tcp://localhost:1883",
                "id": "flogo_publish",
                "qos": 0,
                "topic": "flogo",
                "retain": false,
                "cleanSession": true
              }
            }
          }
        ],
        "links": [
          {
            "from": "log_2",
            "to": "mqtt_3"
          }
        ]
      }
    }
  ]
}
@skothari-tibco
Copy link
Contributor

How are you setting up your mqtt server ?

@dcsouthwick
Copy link
Author

atm its a simple eclipse mosquitto server on localhost, no additional settings

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 a pull request may close this issue.

2 participants