Package io.mats3.api.intercept
package io.mats3.api.intercept
Extension to the
Mats3 API
which adds interception capabilities - all operations for
initiation and stage processing can be intercepted.-
ClassDescriptionCommon part of the interface of
MatsInitiateInterceptor.InitiateCompletedContext
andMatsStageInterceptor.StageCompletedContext
.Common elements of intercepting messages for both Initiate and Stage.Implement this interface to intercept Initiations, then register withMatsInterceptable.addInitiationInterceptor(MatsInitiateInterceptor)
.While still within the initiation context, this interception enables modifying outgoing messages from the user lambda, setting trace properties, adding "sideloads", deleting a message, or initiating additional messages.Enables the intercepting of the invocation of the user lambda in an Initiation, with ability to wrap theMatsInitiator.MatsInitiate
(and thus modify any request, send or publishes) - or even take over the entire initiation.Specifies methods that an interceptable MatsFactory must provide.Marker interface to denote a logging interceptor.Marker interface to denote a metrics interceptor.Combines the interfacesMatsInterceptable
andMatsFactory
.Represents an Outgoing Mats Message.Implement this interface to intercept Stage Processing, then register withMatsInterceptable.addStageInterceptor(MatsStageInterceptor)
.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.Enables the intercepting of the invocation of the "user lambda" in a Stage, with ability to wrap theMatsEndpoint.ProcessContext
(and thus modify any reply, request, next or initiations) and/or modifying state and message - or even take over the entire stage.Common context elements for stage interception, including all the incoming message/envelope data and metadata.The main result of the Stage Processing - if the stage also initiated messages, this will be known byMatsStageInterceptor.StageCompletedContext.getStageInitiatedMessages()
being non-empty.