Package io.mats3.api.intercept
Interface CommonInterceptOutgoingMessagesContext
- All Known Subinterfaces:
MatsInitiateInterceptor.InitiateInterceptOutgoingMessagesContext,MatsStageInterceptor.StageInterceptOutgoingMessageContext
public interface CommonInterceptOutgoingMessagesContext
Common elements of intercepting messages for both Initiate and Stage.
-
Method Summary
Modifier and TypeMethodDescriptionvoidcancelOutgoingMessage(String matsMessageId) To remove an outgoing message, you may invoke this method, providing the uniqueMatsMessageId.voidinitiate(MatsInitiator.InitiateLambda lambda) To add a new message, you may initiate it here.
-
Method Details
-
getOutgoingMessages
List<MatsOutgoingMessage.MatsEditableOutgoingMessage> getOutgoingMessages()- Returns:
- the current list of outgoing messages after the user lambda have run - and after previous interceptors have run, which might have added, or removed messages.
-
initiate
To add a new message, you may initiate it here. Notice that any interceptors that are invoked later than this (interceptor was added later) will have this message show up in itsgetOutgoingMessages(). -
cancelOutgoingMessage
To remove an outgoing message, you may invoke this method, providing the uniqueMatsMessageId. Notice that any interceptors that are invoked later than this (interceptor was added later) will thus not see this message in itsgetOutgoingMessages().- Parameters:
matsMessageId- the unique MatsMessageId, gotten fromMatsOutgoingMessage.getMatsMessageId().
-