public static interface MatsOutgoingMessage.MatsEditableOutgoingMessage extends MatsOutgoingMessage
MatsOutgoingMessage.DispatchType, MatsOutgoingMessage.MatsEditableOutgoingMessage, MatsOutgoingMessage.MatsSentOutgoingMessage, MatsOutgoingMessage.MessageType
Modifier and Type | Method and Description |
---|---|
void |
addBytes(java.lang.String key,
byte[] payload)
Add byte[] sideload to outgoing message.
|
void |
addString(java.lang.String key,
java.lang.String payload)
Add String sideload to outgoing message.
|
void |
setSameStackHeightExtraState(java.lang.String key,
java.lang.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.
|
void |
setTraceProperty(java.lang.String propertyName,
java.lang.Object object)
Set trace property.
|
getBytes, getBytesKeys, getData, getDispatchType, getFlowId, getFrom, getInitialTargetState, getInitiatingAppName, getInitiatingAppVersion, getInitiatorId, getMatsMessageId, getMessageType, getReplyTo, getSameStackHeightState, getString, getStringKeys, getTimeToLive, getTo, getTraceId, getTraceProperty, getTracePropertyKeys, isInteractive, isNoAudit, isNonPersistent, isReplyToSubscription, isToSubscription
void setTraceProperty(java.lang.String propertyName, java.lang.Object object)
void setSameStackHeightExtraState(java.lang.String key, java.lang.Object object)
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)
.void addBytes(java.lang.String key, byte[] payload)
void addString(java.lang.String key, java.lang.String payload)