Class EventPayload

java.lang.Object
com.inductiveautomation.eventstream.EventPayload

public final class EventPayload extends Object
Combines EventStreamSource event data with the events metadata. Data must be included in all EventPayloads, while metadata is optional. Encodings specified in Source and Transform configuration are only applied to data, not metadata. Metadata is used to pass additional information to the Event Stream that a user might find useful. An example is the Kafka Source, the value from received record would be considered data and the partition, offset, key, and additional headers would be metadata.
  • Method Details

    • from

      public static EventPayload from(Object data)
      Creates an EventPayload with no metadata.
      Parameters:
      data - Event data
      Returns:
      EventPayload with no metadata.
    • builder

      public static EventPayload.Builder builder(Object payload)
    • getData

      public Object getData()
      Returns:
      Data associated with event
    • getMetadata

      public Map<String,Object> getMetadata()
      Returns:
      Metadata associated with event
    • replacePayload

      public EventPayload replacePayload(Object data)
      Replaces EventPayload data, keeping the old metadata the same.
      Parameters:
      data - New data to set on EventPayload
      Returns:
      EventPayload with new data and previous metadata