Interface TopicMessageEventContext

All Superinterfaces:
EventContext

public interface TopicMessageEventContext extends EventContext
Describes the topic message of the MessagingService
  • Method Details

    • create

      static TopicMessageEventContext create(String topic)
      Parameters:
      topic - destination topic
      Returns:
      the TopicMessageEventContext
    • getIsInbound

      Boolean getIsInbound()
      Returns the inbound flag
      Returns:
      true, if the message has been received from a message broker or false, if it emitted to a message broker.
    • setIsInbound

      void setIsInbound(boolean inbound)
      Sets the inbound flag
      Parameters:
      inbound - true, if the message has been received from a message broker or false, if it emitted to a message broker.
    • getData

      String getData()
      Returns the plain string message. On inbound messages this is set, if the structured flag is not set (default). In case of a cloudevents message this is the full cloudevents message as String. Note, that either getData() or the two maps getDataMap() and getHeadersMap() are set, never both.
      Returns:
      the plain string message
    • setData

      void setData(String data)
      Sets the plain string message. In case of a cloudevents message this is the full cloudevents message as String. Note, that either getData() or the two maps getDataMap() and getHeadersMap() can be set, never both.
      Parameters:
      data - the plain string message
    • getDataMap

      Map<String,Object> getDataMap()
      Returns the data map. On inbound messages this is set, if the structured flag is set. In case of a cloudevents message the data map corresponds to the map, available under the "data" key. Note, that either getData() or the two maps getDataMap() and getHeadersMap() are set, never both.
      Returns:
      the data map
    • setDataMap

      void setDataMap(Map<String,Object> data)
      Sets the data map. In case of a cloudevents message the data map corresponds to the map, available under the "data" key. Note, that either getData() or the two maps getDataMap() and getHeadersMap() can be set, never both.
      Parameters:
      data - the data map
    • getHeadersMap

      Map<String,Object> getHeadersMap()
      Returns the headers map. On inbound messages this is set, if the structured flag is set. In case of a cloudevents message the headers map contains all properties of the message, except for "data". Note, that either getData() or the two maps getDataMap() and getHeadersMap() are set, never both.
      Returns:
      the header map
    • setHeadersMap

      void setHeadersMap(Map<String,Object> headers)
      Sets the headers map. In case of a cloudevents message the headers map contains all properties of the message, except for "data". Note, that either getData() or the two maps getDataMap() and getHeadersMap() can be set, never both.
      Parameters:
      headers - the structured header data as a map
    • getMessageId

      String getMessageId()
      Returns the message ID usually generated by the message broker
      Returns:
      the message ID usually generated by the message broker
    • setMessageId

      void setMessageId(String id)
      Sets the message ID
      Parameters:
      id - the message ID