public interface MatsStageInterceptor
MatsInterceptable.addStageInterceptor(MatsStageInterceptor)
.
Intercepts stage processors with ability to modify the stage processing, and implement extra logging and metrics
gathering.Modifier and Type | Interface and Description |
---|---|
static interface |
MatsStageInterceptor.MatsStageInterceptOutgoingMessages
While still within the stage process context, this interception enables modifying outgoing messages from the user
lambda, setting trace properties, adding "sideloads", deleting a message, or initiating additional messages.
|
static interface |
MatsStageInterceptor.MatsStageInterceptUserLambda
Enables the intercepting of the invocation of the "user lambda" in a Stage, with ability to wrap the
MatsEndpoint.ProcessContext (and thus modify any reply, request, next or initiations) and/or modifying state and
message - or even take over the entire stage. |
static interface |
MatsStageInterceptor.StageCommonContext
Common context elements for stage interception, including all the incoming message/envelope data and metadata.
|
static interface |
MatsStageInterceptor.StageCompletedContext |
static interface |
MatsStageInterceptor.StageInterceptContext |
static interface |
MatsStageInterceptor.StageInterceptOutgoingMessageContext |
static interface |
MatsStageInterceptor.StageInterceptUserLambdaContext |
static interface |
MatsStageInterceptor.StagePreprocessAndDeserializeErrorContext |
static interface |
MatsStageInterceptor.StageReceivedContext |
Modifier and Type | Method and Description |
---|---|
default void |
stageCompleted(MatsStageInterceptor.StageCompletedContext context)
Invoked after the stage is fully completed, outgoing messages sent, db and messaging system committed.
|
default void |
stageCompletedNextDirect(MatsStageInterceptor.StageCompletedContext context)
Special variant of
stageCompleted(StageCompletedContext) which is invoked when a
MatsEndpoint.ProcessContext.nextDirect(Object) has been performed: As opposed to the ordinary variant, this does
not execute outside the stage's transactional demarcation, since the nextDirect stage processing happens
within the same transactional demarcation as the stage which invoked nextDirect. |
default void |
stagePreprocessAndDeserializeError(MatsStageInterceptor.StagePreprocessAndDeserializeErrorContext context)
Invoked if any of the preprocessing and deserialization activities on the incoming message from the message
system fails, and hence no Stage processing will be performed - i.e., no further methods of the interceptor will
be invoked.
|
default void |
stageReceived(MatsStageInterceptor.StageReceivedContext context)
Invoked right after message have been received, preprocessed and deserialized, before invoking the user lambda.
|
default void stagePreprocessAndDeserializeError(MatsStageInterceptor.StagePreprocessAndDeserializeErrorContext context)
MatsStageInterceptor.StageCompletedContext
of the
stageCompleted(..)
call describe the problem and contain the
cause, see MatsStageInterceptor.StageCompletedContext.ProcessResult.USER_EXCEPTION
and MatsStageInterceptor.StageCompletedContext.ProcessResult.SYSTEM_EXCEPTION
.
Note: This should really never be triggered. It would be prudent to "notify the humans" if it ever did.default void stageReceived(MatsStageInterceptor.StageReceivedContext context)
stagePreprocessAndDeserializeError(StagePreprocessAndDeserializeErrorContext)
is invoked instead).default void stageCompleted(MatsStageInterceptor.StageCompletedContext context)
MatsStageInterceptor.MatsStageInterceptOutgoingMessages
.default void stageCompletedNextDirect(MatsStageInterceptor.StageCompletedContext context)
stageCompleted(StageCompletedContext)
which is invoked when a
MatsEndpoint.ProcessContext.nextDirect(Object)
has been performed: As opposed to the ordinary variant, this does
not execute outside the stage's transactional demarcation, since the nextDirect stage processing happens
within the same transactional demarcation as the stage which invoked nextDirect. Therefore, no outgoing messages
has yet been sent, and db and message system are not yet committed.