package
0.0.0-20200821104852-f76c6d292a95
Repository: https://github.com/jvanderl/flogo-components.git
Documentation: pkg.go.dev

# README

eFTL Subscriber

This trigger provides your flogo application the ability to start a flow via eFTL

Installation

flogo install github.com/jvanderl/flogo-components/trigger/eftl

Link for flogo web:

https://github.com/jvanderl/flogo-components/trigger/eftl

Schema

Settings, Outputs and Endpoint:

{
  "settings":[
    {
      "name": "server",
      "type": "string",
      "required" : true
    },
    {
      "name": "clientid",
      "type": "string",
      "required" : true
    },
    {
      "name": "channel",
      "type": "string",
      "required" : true
    },
    {
      "name": "user",
      "type": "string",
      "required" : false
    },
    {
      "name": "password",
      "type": "string",
      "required" : false
    },
    {
      "name": "secure",
      "type": "boolean",
      "required" : true
    },
    {
      "name": "certificate",
      "type": "string",
      "required" : false
    }
  ],
  "output": [
    {
      "name": "message",
      "type": "object"
    }
  ],
  "reply": [
    {
      "name": "data",
      "type": "object"
    }
  ],
  "handler": {
    "settings": [
      {
        "name": "matcher",
        "type": "string",
        "required" : true
      },
      {
        "name": "durable",
        "type": "boolean",
        "required" : true
      },
      {
        "name": "durablename",
        "type": "string",
        "required" : false
      }
    ]
  }
}

Settings

SettingDescription
serverthe eFTL server [hostname]:[port]
clientidthe client id to identify the eFTL connection
channelThe channel to send the message to (e.g. /channel)
messageThe actual message to send
userThe username to connect to the WebSocket server (e.g. user)
passwordThe password to connect to the WebSocket server (e.g. password)
secureDetermines to use secure web sockets (wss)
certThe eFTL server certificate data in base64 encoded PEM format (only used if secure is true)

Ouputs

OutputDescription
messageThe message object

Handlers

SettingDescription
destinationThe destination to subscribe to (e.g. 'Default'), can also do '{"_dest":"subject"}'
usesubjectUse subject (set to false if you're only subscribing to a destination)
subjectUse this to match a specific subject of interest (when provided by sender)
durableUse durable subscription
durablenameDurable subscription name (only needed when durable is set to 'true')

Example Configurations

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

Start a flow

Configure the Trigger to start "testFlow". So in this case the "endpoints" "settings" "destination" is "flogo" will start "testFlow" flow when a message arrives on a destination called "flogo" in this case.

{
  "name": "eftl",
  "settings": {
    "server": "localhost:9191",
    "cclientid": "flogo-subscriber",
    "channel": "/channel",
    "user": "",
    "password": "",
    "secure": "false",
    "certificate": "*** Base64 encoded PEM cert data here ***"
  },
  "handlers": [
    {
      "actionId": "local://testFlow",
      "settings": {
        "destination": "flogo",
        "subject": "sensor1",
        "durable": "false"
      }
    }
  ]
}