Interface FluxCapacitorConfiguration
- All Known Subinterfaces:
FluxCapacitorBuilder
- All Known Implementing Classes:
DefaultFluxCapacitor.Builder
public interface FluxCapacitorConfiguration
Central configuration interface for a Flux Capacitor client instance.
This interface exposes all essential configuration components and extension points that influence message serialization, handler invocation, scheduling, caching, dispatching, user context, and more.
Implementations of this interface are typically created via FluxCapacitorBuilder
and can be
accessed through FluxCapacitor.configuration()
at runtime.
Responsibilities
- Provide serializers for messages, snapshots, and documents.
- Define consumer tracking and dispatch configuration per
MessageType
. - Register interceptors and decorators for dispatching, batching, and handling messages.
- Expose platform services like clock, caching, scheduling, and task execution.
- Supply user and identity resolution logic for context-aware operations.
Custom configuration
Many of the returned values (e.g. interceptors, decorators, resolvers) are lists or maps that can be extended to modify the behavior of message handling and dispatch. Lists are ordered by priority (high or low), and are evaluated in that order during processing.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptioncache()
Default cache used for internal stateful optimizations (e.g. handler state, snapshots).clock()
Provides a central clock used throughout the system for timestamps and scheduling.Returns the provider responsible for adding correlation data to outgoing messages.Provides custom consumer configurations per message type.List
<ParameterResolver<? super DeserializingMessage>> Returns additional resolvers for injecting parameters into message handler methods.Provides the default consumer configuration per message type.Default response mapper used for converting handler return values into generic responses.Returns the serializer used to store and retrieve documents in theDocumentStore
.Internal web consumer that can forward incomingWebRequest
messages to a local HTTP server.Interceptors applied to message batches during tracking and dispatch.Dispatch interceptors applied before low-priority interceptors.Decorators applied to handlers before low-priority decorators.Returns the provider used to generate or resolve application-specific identities.Dispatch interceptors applied after high-priority interceptors.Decorators applied to handlers after high-priority decorators.boolean
Whether the application instance should be created automatically on first use.Special interceptor used to determine routing of dispatched messages (e.g. for multitenancy).Provides access to configuration properties (typically loaded from the environment).Dedicated cache used to store and lookup relationships between entities.Interceptor applied to scheduled messages, such as time-based commands or events.Returns the primary serializer for serializing and deserializing message payloads.Returns the serializer used for serializing and deserializing snapshots of stateful entities.Task scheduler used for asynchronous background task execution.Returns the provider used to determine the current authenticated or active user.Mapper used for converting web handler return values intoWebResponse
objects.
-
Method Details
-
serializer
Serializer serializer()Returns the primary serializer for serializing and deserializing message payloads. -
snapshotSerializer
Serializer snapshotSerializer()Returns the serializer used for serializing and deserializing snapshots of stateful entities. -
correlationDataProvider
CorrelationDataProvider correlationDataProvider()Returns the provider responsible for adding correlation data to outgoing messages. -
documentSerializer
DocumentSerializer documentSerializer()Returns the serializer used to store and retrieve documents in theDocumentStore
. -
defaultConsumerConfigurations
Map<MessageType,ConsumerConfiguration> defaultConsumerConfigurations()Provides the default consumer configuration per message type. -
customConsumerConfigurations
Map<MessageType,List<ConsumerConfiguration>> customConsumerConfigurations()Provides custom consumer configurations per message type. -
customParameterResolvers
List<ParameterResolver<? super DeserializingMessage>> customParameterResolvers()Returns additional resolvers for injecting parameters into message handler methods. -
lowPrioDispatchInterceptors
Map<MessageType,List<DispatchInterceptor>> lowPrioDispatchInterceptors()Dispatch interceptors applied after high-priority interceptors. -
highPrioDispatchInterceptors
Map<MessageType,List<DispatchInterceptor>> highPrioDispatchInterceptors()Dispatch interceptors applied before low-priority interceptors. -
lowPrioHandlerDecorators
Map<MessageType,List<HandlerDecorator>> lowPrioHandlerDecorators()Decorators applied to handlers after high-priority decorators. -
highPrioHandlerDecorators
Map<MessageType,List<HandlerDecorator>> highPrioHandlerDecorators()Decorators applied to handlers before low-priority decorators. -
generalBatchInterceptors
Map<MessageType,List<BatchInterceptor>> generalBatchInterceptors()Interceptors applied to message batches during tracking and dispatch. -
clock
DelegatingClock clock()Provides a central clock used throughout the system for timestamps and scheduling. -
messageRoutingInterceptor
DispatchInterceptor messageRoutingInterceptor()Special interceptor used to determine routing of dispatched messages (e.g. for multitenancy). -
schedulingInterceptor
SchedulingInterceptor schedulingInterceptor()Interceptor applied to scheduled messages, such as time-based commands or events. -
taskScheduler
TaskScheduler taskScheduler()Task scheduler used for asynchronous background task execution. -
forwardingWebConsumer
ForwardingWebConsumer forwardingWebConsumer()Internal web consumer that can forward incomingWebRequest
messages to a local HTTP server. Typically configured viaFluxCapacitorBuilder.forwardWebRequestsToLocalServer(int)
. -
cache
Cache cache()Default cache used for internal stateful optimizations (e.g. handler state, snapshots). -
relationshipsCache
Cache relationshipsCache()Dedicated cache used to store and lookup relationships between entities. -
defaultResponseMapper
ResponseMapper defaultResponseMapper()Default response mapper used for converting handler return values into generic responses. -
webResponseMapper
WebResponseMapper webResponseMapper()Mapper used for converting web handler return values intoWebResponse
objects. -
makeApplicationInstance
boolean makeApplicationInstance()Whether the application instance should be created automatically on first use. -
userProvider
UserProvider userProvider()Returns the provider used to determine the current authenticated or active user. -
identityProvider
IdentityProvider identityProvider()Returns the provider used to generate or resolve application-specific identities. -
propertySource
PropertySource propertySource()Provides access to configuration properties (typically loaded from the environment).
-