package
0.0.0-20230502073429-587acefb9ced
Repository: https://github.com/ayh20/flogo-components.git
Documentation: pkg.go.dev

# README

tibco-mqtt

This trigger provides your flogo application the ability to start a flow via MQTT (with TLS support for AWS, Hono and Bosch IoT)

Installation

flogo install github.com/ayh20/flogo-components/trigger/mqtt

Link for flogo web:

https://github.com/ayh20/flogo-components/trigger/mqtt

Schema

Settings, Outputs and Endpoint:

{
  "settings":[
      {
        "name": "broker",
        "type": "string"
      },
      {
        "name": "id",
        "type": "string"
      },
      {
        "name": "user",
        "type": "string"
      },
      {
        "name": "password",
        "type": "string"
      },
      {
        "name": "enabletls",
        "type": "boolean",
        "required": true
      },
      {
        "name": "certstore",
        "type": "string"
      },
      {
        "name": "thing",
        "type": "string"
      },
      {
        "name": "store",
        "type": "string"
      },
      {
        "name": "qos",
        "type": "integer"
      },
      {
        "name": "keepalive",
        "type": "integer"
      },
      {
        "name": "cleansess",
        "type": "boolean"
      }
    ],
    "endpoint": {
      "settings": [
        {
          "name": "topic",
          "type": "string"
        }
      ]
    }
}

Certificate Installation

For AWS

If the certstore parm is empty the activity looks for the Aws device certificates in the directory where the engine was started. If certstore is specified then it will use this directory to find the files. Download the AWS root CA certificate file and save it as "root-CA.crt". Now place the cert and private key generated by Aws IoT for your "thing" as "thing".cert.pem and "thing".private.key respectively (if you download the sample from AWS this is the naming convention it uses).

For Hono/Bosch and other TLS support.

certstore points to the servers root cert. This is the full filename. user and password will need to be specified if required by the server.

Example Configurations

Triggers are configured via the triggers.json of your application. The following are some example configuration of the MQTT Trigger.

Start a flow

Configure the Trigger to start "myflow". "settings" "topic" is the topic it uses to listen for incoming messages. So in this case the "endpoints" "settings" "topic" is "test_start" will start "myflow" flow. The incoming message payload has to define "replyTo" which is the the topic used to reply on.

{
  "triggers": [
    {
      "name": "tibco-mqtt",
      "settings": {
        "topic": "flogo/#",
        "broker": "ssl://a3730revvijqbs.iot.us-east-1.amazonaws.com:8883",
        "id": "flogo",
        "user": "",
        "password": "",
        "store": "",
        "qos": "0",
        "cleansess": "false"
      },
      "endpoints": [
        {
          "actionType": "flow",
          "actionURI": "embedded://myflow",
          "settings": {
            "topic": "test_start"
          }
        }
      ]
    }
  ]
}