Interface MatsOutgoingMessage.MatsEditableOutgoingMessage

All Superinterfaces:
All Known Implementing Classes:
Enclosing interface:

public static interface MatsOutgoingMessage.MatsEditableOutgoingMessage extends MatsOutgoingMessage
  • Method Details

    • setTraceProperty

      void setTraceProperty(String propertyName, Object object)
      Set trace property.
    • setSameStackHeightExtraState

      void setSameStackHeightExtraState(String key, Object object)
      An interceptor might need to add state to an outgoing message which will be present on incoming message of the next stage of a multi-stage endpoint - i.e. "extra state" in addition to the State class that the user has specified for the Endpoint.

      Only relevant for MatsOutgoingMessage.MessageType.REQUEST, MatsOutgoingMessage.MessageType.NEXT and MatsOutgoingMessage.MessageType.GOTO - will throw IllegalStateException otherwise.

      REQUEST: If extra-state is added to an outgoing REQUEST-message from ServiceA.stage1, it will be present again on the subsequent REPLY-message to ServiceA.stage2 (and any subsequent stages).

      NEXT: If extra-state is added to an outgoing NEXT-message from ServiceA.stage1, it will be present again on the subsequent incoming message to ServiceA.stage2 (and any subsequent stages).

      To add info to the receiving stage of a REQUEST, you may employ addBytes(String, byte[]) and addString(String, String). Given that such extra-state would need support from the receiving endpoint too to make much sense (i.e. an installed interceptor reading and understanding the incoming extra state, typically the same interceptor installed there as the one adding the state), it could just pick up the side load and transfer it over to the extra state if that was desired. Therefore, even though it could be possible to add extra-state to the targeted/receiving endpoint, I've decided against it so far.

      The extra-state is available on the stage interception at MatsStageInterceptor.StageCommonContext.getIncomingSameStackHeightExtraState(String, Class).

    • addBytes

      void addBytes(String key, byte[] payload)
      Add byte[] sideload to outgoing message.
    • addString

      void addString(String key, String payload)
      Add String sideload to outgoing message.