Package io.mats3
package io.mats3
API for Mats3: Message-based Asynchronous Transactional Staged Stateless Services.
-
ClassDescriptionAll of
MatsFactory
,MatsEndpoint
andMatsStage
have some configurable elements, provided by a config instance, this is the top of that hierarchy.MatsEndpoint<R,S> Represents a Mats Endpoint - you create instances from theMatsFactory
(or use the Spring integration).The part ofMatsEndpoint.ProcessContext
that exposes the "getter" side of the context, which enables it to be exposed outside of the process lambda.Provides for both configuring the endpoint (before it is started), and introspecting the configuration.For the incoming message type, this represents the equivalent of Java'sObject
- a "generic" incoming message whose type is not yet determined.Can be thrown by theMatsEndpoint.ProcessLambda
of theMatsStage
s to denote that it would prefer this message to be instantly put on a Dead Letter Queue (the stage processing, including any database actions, will still be rolled back as with any other exception thrown out of a ProcessLambda).A way for the process stage to communicate with the library, providing methods to invoke a request, send a reply (for multi-stage endpoints, this provides a way to do a "early return"), initiate a new message etc.A base Wrapper forMatsEndpoint.ProcessContext
, which simply implements ProcessContext, takes a ProcessContext instance and forwards all calls to that.MatsEndpoint.ProcessLambda<R,S, I> The lambda that shall be provided by the developer for the process stage(s) for the endpoint - provides the context, state and incoming message DTO.Specialization ofProcessLambda
that makes it possible to do a "return replyDto" at the end of the stage, which is just a convenient way to invokeMatsEndpoint.ProcessContext.reply(Object)
.Specialization ofProcessLambda
which does not have a state, and have the same return-semantics asProcessReturnLambda
- used for single-stage endpoints as these does not have multiple stages to transfer state between.Specialization ofProcessLambda
which does not have reply specified - used for terminator endpoints.The start point for all interaction with Mats - you need to get hold of an instance of this interface to be able to code and configure Mats endpoints, and to performinitiations
like sending a message, perform a request and publish a message.Provides ThreadLocal access to attributes from theMatsInitiator.MatsInitiate
initiate context andMatsStage
process context - currentlyMatsFactory.ContextLocal.getAttribute(Class, String...)
, which can provide you with the transactionally demarcated SQL Connection if the Mats implementation provides such.Provides for a way to configure factory-wide elements and defaults.A base Wrapper forMatsFactory
, which simply implements MatsFactory, takes a MatsFactory instance and forwards all calls to that.Base Wrapper interface which Mats-specific Wrappers implements, defining four "wrappee" methods.Provides the means to get hold of aMatsInitiator.MatsInitiate
instance for initiating Mats message flows: You fetch an instance implementing this interface using typicallyMatsFactory.getDefaultInitiator()
, and then invokeMatsInitiator.initiate(InitiateLambda)
, where the lambda will provide you with the necessaryMatsInitiator.MatsInitiate
instance on which you have methods to construct and dispatch e.g.@FunctionalInterface
for the "initiate lambda" - what you supply to theinitiate
method.A hint to the underlying implementation of how much historic debugging information for the call flow should be retained in the underlying protocol.Will be thrown by theMatsInitiator.initiate(InitiateLambda)
-method if it is not possible at this time to establish a connection to the underlying messaging system (e.g.Unchecked variant of theMatsInitiator.MatsBackendException
, thrown from theMatsInitiator.initiateUnchecked(InitiateLambda)
variant of initiate().An implementation of this interface is given to you when you want to initiate a new Mats Flow.A base Wrapper forMatsInitiator.MatsInitiate
, which simply implements MatsInitiate, takes a MatsInitiate instance and forwards all calls to that.Will be thrown by theMatsInitiator.initiate(InitiateLambda)
-method if Mats fails to send the messages after theMatsInitiator.InitiateLambda
has been run, any external resource (typically DB) has been committed, and then some situation occurs that makes it impossible to send out messages.Unchecked variant of theMatsInitiator.MatsMessageSendException
, thrown from theMatsInitiator.initiateUnchecked(InitiateLambda)
variant of initiate().Reference information about the outgoing message.MatsStage<R,S, I> A representation of a process stage of aMatsEndpoint
.MatsStage.StageConfig<R,S, I> Provides for both configuring the stage (before it is started), and introspecting the configuration.