Event Generators

Event Generators asynchronously emit events to be consumed by pipelines. At present, there is only the timer generator, used to generate events on an interval or at startup.


Event Generators

EventGenerator

Describes the configuration for an EventGenerator.
For an example of an EventGenerator, see timer.

Referenced By:
EdgeConnectConfig   RecipeDefinition  

Fields

NameTypeDescriptionRequired
configobjectConfiguration information for the particular type of EventGenerator used. Described in the documentation for each event generator type.No
typestringThe unique type of the EventGenerator.
Example: "timer"
Yes

Event Generator Types

timer

The timer eventGenerator allows generation of periodic or oneshot timer events.

On a timer tick, a timer event will be output with the following keys:


{
"eventGenerator": "my-5s-ticker", (string)
"eventType": "5s-tick", (string)
"time": "2020-09-03T23:53:51.155076768Z", (time.Time)
"tickCount": 76, (int)
"interval": 5000000000, (time.Duration)
}

Output: eventMap if defined, otherwise a timer event as described above

Fields

NameTypeDescriptionRequired
debugbooleanEnable debug loggingNo
eventTypestringTimer event type
Example: "my-timer-event"
Yes
intervalpositiveDuration
templating
Timer tick interval (positive duration string)Yes
keyPairsobject
templating
dot notation
Key pairs to emit on timer tick event.
Example: { "message": "Happy Birthday {{ Serial }}!", "type": "Birthday Card"}
No
oneshotbooleanTimer will ony fire one time, not repeatedlyNo
verbosebooleanEnable verbose loggingNo

Example

{
  "service": {
    "eventGenerators": {
      "exampleTimer": {
        "config": {
          "eventType": "heartbeat",
          "interval": 1000000000,
          "keyPairs": {
            "timestamp": "{{ return Timestamp }}"
          }
        },
        "type": "timer"
      }
    }
  }
}