public class SagaConfiguration<S> extends Object implements ModuleConfiguration
Modifier and Type | Method and Description |
---|---|
SagaConfiguration<S> |
configureErrorHandler(Function<Configuration,ErrorHandler> errorHandler)
Deprecated.
|
SagaConfiguration<S> |
configureListenerInvocationErrorHandler(Function<Configuration,ListenerInvocationErrorHandler> listenerInvocationErrorHandler)
Configures the ListenerInvocationErrorHandler to use when processing of event in saga fails.
|
SagaConfiguration<S> |
configureMessageMonitor(Function<Configuration,MessageMonitor<? super EventMessage<?>>> messageMonitor)
Deprecated.
|
SagaConfiguration<S> |
configureRollbackConfiguration(Function<Configuration,RollbackConfiguration> rollbackConfiguration)
Deprecated.
|
SagaConfiguration<S> |
configureSagaStore(Function<Configuration,SagaStore<? super S>> sagaStoreBuilder)
Configures the Saga Store to use to store Saga instances of this type.
|
SagaConfiguration<S> |
configureTokenStore(Function<Configuration,TokenStore> tokenStore)
Deprecated.
|
SagaConfiguration<S> |
configureTrackingProcessor(Function<Configuration,TrackingEventProcessorConfiguration> trackingEventProcessorConfiguration)
Registers the
TrackingEventProcessorConfiguration to use when building the processor for this Saga type. |
SagaConfiguration<S> |
configureTransactionManager(Function<Configuration,TransactionManager> transactionManager)
Deprecated.
|
EventProcessor |
getProcessor()
Returns the processor that processed events for the Saga in this Configuration.
|
AnnotatedSagaManager<S> |
getSagaManager()
Returns the SagaManager responsible for managing the lifecycle and invocation of Saga instances of the type
defined in this Configuration
|
SagaRepository<S> |
getSagaRepository()
Returns the SagaRepository instance used to load Saga instances in this Configuration.
|
SagaStore<? super S> |
getSagaStore()
Returns the Saga Store used by the Saga defined in this Configuration.
|
Class<S> |
getSagaType()
Gets the saga type.
|
void |
initialize(Configuration config)
Initialize the module configuration using the given global
config |
SagaConfiguration<S> |
registerHandlerInterceptor(Function<Configuration,MessageHandlerInterceptor<? super EventMessage<?>>> handlerInterceptorBuilder)
Deprecated.
|
void |
shutdown()
Invoked prior to shutdown of the application.
|
void |
start()
Invoked when the Configuration is started.
|
static <S> SagaConfiguration<S> |
subscribingSagaManager(Class<S> sagaType)
Initialize a configuration for a Saga of given
sagaType , using a Subscribing Event Processor to process
incoming Events. |
static <S> SagaConfiguration<S> |
subscribingSagaManager(Class<S> sagaType,
Function<Configuration,SubscribableMessageSource<EventMessage<?>>> messageSourceBuilder)
Initialize a configuration for a Saga of given
sagaType , using a Subscribing Event Processor to process
incoming Events from the message source provided by given messageSourceBuilder |
static <S> SagaConfiguration<S> |
subscribingSagaManager(Class<S> sagaType,
Function<Configuration,SubscribableMessageSource<EventMessage<?>>> messageSourceBuilder,
Function<Configuration,EventProcessingStrategy> eventProcessingStrategy)
Initialize a configuration for a Saga of given
sagaType , using a Subscribing Event Processor to process
incoming Events from the message source provided by given messageSourceBuilder . |
static <S> SagaConfiguration<S> |
subscribingSagaManager(Class<S> sagaType,
String processingGroup)
Initialize a configuration for a Saga of given
sagaType , using a Subscribing Event Processor (with
provided name) to process incoming Events. |
static <S> SagaConfiguration<S> |
subscribingSagaManager(Class<S> sagaType,
String processingGroup,
Function<Configuration,SubscribableMessageSource<EventMessage<?>>> messageSourceBuilder,
Function<Configuration,EventProcessingStrategy> eventProcessingStrategy)
Initialize a configuration for a Saga of given
sagaType , using a Subscribing Event Processor (with
provided name) to process incoming Events from the message source provided by given messageSourceBuilder . |
static <S> SagaConfiguration<S> |
trackingSagaManager(Class<S> sagaType)
Initialize a configuration for a Saga of given
sagaType , using a Tracking Event Processor to process
incoming Events. |
static <S> SagaConfiguration<S> |
trackingSagaManager(Class<S> sagaType,
Function<Configuration,StreamableMessageSource<TrackedEventMessage<?>>> messageSourceBuilder)
Initialize a configuration for a Saga of given
sagaType , using a Tracking Event Processor to process
incoming Events from a Message Source provided by given messageSourceBuilder . |
static <S> SagaConfiguration<S> |
trackingSagaManager(Class<S> sagaType,
String processingGroup)
Initialize a configuration for a Saga of given
sagaType , using a Tracking Event Processor (with provided
name) to process incoming Events. |
static <S> SagaConfiguration<S> |
trackingSagaManager(Class<S> sagaType,
String processingGroup,
Function<Configuration,StreamableMessageSource<TrackedEventMessage<?>>> messageSourceBuilder)
Initialize a configuration for a Saga of given
sagaType , using a Tracking Event Processor (with provided
name) to process incoming Events from a Message Source provided by given messageSourceBuilder . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
phase, unwrap
public void start()
ModuleConfiguration
start
in interface ModuleConfiguration
Configuration.start()
public void shutdown()
ModuleConfiguration
shutdown
in interface ModuleConfiguration
Configuration.shutdown()
public static <S> SagaConfiguration<S> subscribingSagaManager(Class<S> sagaType)
sagaType
, using a Subscribing Event Processor to process
incoming Events.S
- The type of Saga configured in this configurationsagaType
- The type of Saga to handle events withpublic static <S> SagaConfiguration<S> subscribingSagaManager(Class<S> sagaType, String processingGroup)
sagaType
, using a Subscribing Event Processor (with
provided name) to process incoming Events.S
- The type of Saga configured in this configurationsagaType
- The type of Saga to handle events withprocessingGroup
- The name of the processing group to be used for this sagapublic static <S> SagaConfiguration<S> subscribingSagaManager(Class<S> sagaType, Function<Configuration,SubscribableMessageSource<EventMessage<?>>> messageSourceBuilder)
sagaType
, using a Subscribing Event Processor to process
incoming Events from the message source provided by given messageSourceBuilder
S
- The type of Saga configured in this configurationsagaType
- The type of Saga to handle events withmessageSourceBuilder
- The function providing the message source based on the configurationpublic static <S> SagaConfiguration<S> subscribingSagaManager(Class<S> sagaType, Function<Configuration,SubscribableMessageSource<EventMessage<?>>> messageSourceBuilder, Function<Configuration,EventProcessingStrategy> eventProcessingStrategy)
sagaType
, using a Subscribing Event Processor to process
incoming Events from the message source provided by given messageSourceBuilder
.
This methods allows a custom EventProcessingStrategy
to be provided, in case handlers shouldn't be
invoked in the thread that delivers the message.
S
- The type of Saga configured in this configurationsagaType
- The type of Saga to handle events withmessageSourceBuilder
- The function providing the message source based on the configurationeventProcessingStrategy
- The strategy to use to invoke the event handlers.public static <S> SagaConfiguration<S> subscribingSagaManager(Class<S> sagaType, String processingGroup, Function<Configuration,SubscribableMessageSource<EventMessage<?>>> messageSourceBuilder, Function<Configuration,EventProcessingStrategy> eventProcessingStrategy)
sagaType
, using a Subscribing Event Processor (with
provided name) to process incoming Events from the message source provided by given messageSourceBuilder
.
This method allows a custom EventProcessingStrategy
to be provided, in case handlers shouldn't be
invoked in the thread that delivers the message.
S
- The type of Saga configured in this configurationsagaType
- The type of Saga to handle events withprocessingGroup
- The name of the processing group to be used for this sagamessageSourceBuilder
- The function providing the message source based on the configurationeventProcessingStrategy
- The strategy to use to invoke the event handlers.public static <S> SagaConfiguration<S> trackingSagaManager(Class<S> sagaType)
sagaType
, using a Tracking Event Processor to process
incoming Events. Note that a Token Store should be configured in the global configuration, or the Saga Manager
will default to an in-memory token store, which is not recommended for production environments.S
- The type of Saga configured in this configurationsagaType
- The type of Saga to handle events withpublic static <S> SagaConfiguration<S> trackingSagaManager(Class<S> sagaType, String processingGroup)
sagaType
, using a Tracking Event Processor (with provided
name) to process incoming Events. Note that a Token Store should be configured in the global configuration, or
the Saga Manager will default to an in-memory token store, which is not recommended for production environments.S
- The type of Saga configured in this configurationsagaType
- The type of Saga to handle events withprocessingGroup
- The name of the processing group to be used for this sagapublic static <S> SagaConfiguration<S> trackingSagaManager(Class<S> sagaType, Function<Configuration,StreamableMessageSource<TrackedEventMessage<?>>> messageSourceBuilder)
sagaType
, using a Tracking Event Processor to process
incoming Events from a Message Source provided by given messageSourceBuilder
. Note that a Token Store
should be configured in the global configuration, or the Saga Manager will default to an in-memory token store,
which is not recommended for production environments.S
- The type of Saga configured in this configurationsagaType
- The type of Saga to handle events withmessageSourceBuilder
- The function providing the message source based on the configurationpublic static <S> SagaConfiguration<S> trackingSagaManager(Class<S> sagaType, String processingGroup, Function<Configuration,StreamableMessageSource<TrackedEventMessage<?>>> messageSourceBuilder)
sagaType
, using a Tracking Event Processor (with provided
name) to process incoming Events from a Message Source provided by given messageSourceBuilder
. Note that
a Token Store should be configured in the global configuration, or the Saga Manager will default to an in-memory
token store, which is not recommended for production environments.S
- The type of Saga configured in this configurationsagaType
- The type of Saga to handle events withprocessingGroup
- The name of the processing group to be used for this sagamessageSourceBuilder
- The function providing the message source based on the configurationpublic SagaConfiguration<S> configureSagaStore(Function<Configuration,SagaStore<? super S>> sagaStoreBuilder)
sagaStoreBuilder
- The builder that returns a fully initialized Saga Store instance based on the global
Configuration@Deprecated public SagaConfiguration<S> registerHandlerInterceptor(Function<Configuration,MessageHandlerInterceptor<? super EventMessage<?>>> handlerInterceptorBuilder)
EventProcessingConfiguration.registerHandlerInterceptor(String, Function)
insteadhandlerInterceptorBuilder
function with
the processor defined in this configuration.handlerInterceptorBuilder
- The function to create the interceptor based on the current configurationpublic SagaConfiguration<S> configureTrackingProcessor(Function<Configuration,TrackingEventProcessorConfiguration> trackingEventProcessorConfiguration)
TrackingEventProcessorConfiguration
to use when building the processor for this Saga type.
Note that the provided configuration is ignored when a subscribing processor is being used.
trackingEventProcessorConfiguration
- The function to create the configuration instance@Deprecated public SagaConfiguration<S> configureTokenStore(Function<Configuration,TokenStore> tokenStore)
EventProcessingConfiguration.registerTokenStore(String, Function)
insteadtokenStore
for use by a TrackingProcessor for the Saga being configured. The
TokenStore is ignored when a Subscribing Processor has been configured.tokenStore
- The function returning a TokenStore based on the given Configuration@Deprecated public SagaConfiguration<S> configureErrorHandler(Function<Configuration,ErrorHandler> errorHandler)
EventProcessingConfiguration.configureErrorHandler(String, Function)
insteadThe default is to propagate errors, causing the processors to release their token and go into a retry loop.
errorHandler
- The function to create the ErrorHandlerpublic SagaConfiguration<S> configureListenerInvocationErrorHandler(Function<Configuration,ListenerInvocationErrorHandler> listenerInvocationErrorHandler)
The default is to log errors.
listenerInvocationErrorHandler
- The function to create ListenerInvocationErrorHandler@Deprecated public SagaConfiguration<S> configureRollbackConfiguration(Function<Configuration,RollbackConfiguration> rollbackConfiguration)
EventProcessingConfiguration.configureRollbackConfiguration(String, Function)
insteadDefaults to roll back on all exceptions.
rollbackConfiguration
- The function providing the RollbackConfiguration to use@Deprecated public SagaConfiguration<S> configureTransactionManager(Function<Configuration,TransactionManager> transactionManager)
EventProcessingConfiguration.configureTransactionManager(String, Function)
insteadDefaults to the Transaction Manager defined in the main Configuration.
transactionManager
- The function providing the TransactionManager to use@Deprecated public SagaConfiguration<S> configureMessageMonitor(Function<Configuration,MessageMonitor<? super EventMessage<?>>> messageMonitor)
EventProcessingConfiguration.configureMessageMonitor(String, Function)
insteadmessageMonitor
- The function to create the MessageMonitorpublic void initialize(Configuration config)
ModuleConfiguration
config
initialize
in interface ModuleConfiguration
config
- the global configuration, providing access to generic componentspublic EventProcessor getProcessor()
IllegalStateException
- when this configuration hasn't been initialized yetpublic SagaStore<? super S> getSagaStore()
IllegalStateException
- when this configuration hasn't been initialized yetpublic SagaRepository<S> getSagaRepository()
IllegalStateException
- when this configuration hasn't been initialized yetpublic AnnotatedSagaManager<S> getSagaManager()
IllegalStateException
- when this configuration hasn't been initialized yetCopyright © 2010–2018. All rights reserved.