Interface FluxzeroBuilder
- All Superinterfaces:
FluxzeroConfiguration
- All Known Implementing Classes:
DefaultFluxzero.Builder
Fluxzero instance.
This interface exposes advanced configuration hooks for customizing message handling, dispatch behavior,
serialization, user resolution, correlation tracking, and many other aspects of a Fluxzero client. It is primarily
used via DefaultFluxzero but can be extended or wrapped for deeper
integrations.
-
Method Summary
Modifier and TypeMethodDescriptionaddBatchInterceptor(BatchInterceptor interceptor, MessageType... forTypes) Registers aBatchInterceptorthat applies to the given message types.addConsumerConfiguration(ConsumerConfiguration consumerConfiguration, MessageType... messageTypes) Adds a specific consumer configuration for one or more message types.addDispatchInterceptor(DispatchInterceptor interceptor, boolean highPriority, MessageType... forTypes) Adds aDispatchInterceptorfor specified message types with optional priority.default FluxzeroBuilderaddDispatchInterceptor(DispatchInterceptor interceptor, MessageType... forTypes) Adds aDispatchInterceptorthat modifies or monitors message dispatch.addHandlerDecorator(HandlerDecorator decorator, boolean highPriority, MessageType... forTypes) Adds aHandlerDecoratorwith control over priority.default FluxzeroBuilderaddHandlerDecorator(HandlerDecorator decorator, MessageType... forTypes) Adds aHandlerDecoratorfor the given message types.default FluxzeroBuilderaddHandlerInterceptor(HandlerInterceptor interceptor, boolean highPriority, MessageType... forTypes) Adds aHandlerInterceptorwith specified priority.default FluxzeroBuilderaddHandlerInterceptor(HandlerInterceptor interceptor, MessageType... forTypes) Adds aHandlerInterceptorfor given message types.addParameterResolver(ParameterResolver<? super DeserializingMessage> parameterResolver) Registers aParameterResolverto support injection of method arguments in handlers.default FluxzeroBuilderaddPropertySource(PropertySource propertySource) Adds aPropertySourceto the configuration chain.Builds the Fluxzero instance using the provided low-levelClient.configureDefaultConsumer(MessageType messageType, UnaryOperator<ConsumerConfiguration> updateFunction) Update the default consumer configuration for the specified message type.Disables support for dynamically injected dispatch interceptors.Disables automatic caching of aggregates.default FluxzeroBuilderHelper method that disables all processes that contain automatic trackers.Disables metrics related to cache eviction.Disables security filtering based on@FilterContent.Disables automatic error reporting (e.g., viaErrorGateway).Disables Fluxzero’s built-in keepalive mechanism.Disables automatic message correlation.Disables payload validation.Prevents installation of the default scheduled command handler.Prevents registration of a shutdown hook.Disables tracking of processing metrics.Disables compression for web responses.default FluxzeroBuilderforwardWebRequestsToLocalServer(int port) Forwards incomingMessageType.WEBREQUESTmessages to a locally running HTTP server on the specified port.forwardWebRequestsToLocalServer(LocalServerConfig localServerConfig, UnaryOperator<ConsumerConfiguration> consumerConfigurator) Configures forwarding ofMessageType.WEBREQUESTmessages to a local HTTP server using the specifiedLocalServerConfigand custom consumer configuration.makeApplicationInstance(boolean makeApplicationInstance) Marks the built instance as the global (application-level)Fluxzero.registerUserProvider(UserProvider userProvider) Registers a user provider used for resolving and authenticatingUserinstances.replaceCache(Cache cache) Replaces the default cache implementation.replaceCorrelationDataProvider(UnaryOperator<CorrelationDataProvider> correlationDataProvider) Replaces theCorrelationDataProviderused to attach correlation data to messages.replaceDefaultResponseMapper(ResponseMapper responseMapper) Replaces the default response mapper used for generic result mapping.replaceDocumentSerializer(DocumentSerializer documentSerializer) Replaces the document serializer for search indexing.replaceIdentityProvider(UnaryOperator<IdentityProvider> replaceFunction) Replaces the identity provider used to generate message and entity identifiers.replaceMessageRoutingInterceptor(DispatchInterceptor messageRoutingInterceptor) Replaces the default routing interceptor used for message dispatch.replacePropertySource(UnaryOperator<PropertySource> replacer) Replaces the existing property source.replaceRelationshipsCache(UnaryOperator<Cache> replaceFunction) Replaces the internal relationships cache with a new implementation.replaceSerializer(Serializer serializer) Replaces the default serializer used for events, commands, snapshots, and documents.replaceSnapshotSerializer(Serializer serializer) Overrides the serializer used specifically for snapshot serialization.replaceTaskScheduler(Function<Clock, TaskScheduler> function) Replaces the defaultTaskSchedulerimplementation.replaceWebResponseMapper(WebResponseMapper webResponseMapper) Replaces theWebResponseMapperused for handling web responses.withAggregateCache(Class<?> aggregateType, Cache cache) Configures a dedicated cache for a specific aggregate type.Methods inherited from interface FluxzeroConfiguration
cache, clock, correlationDataProvider, customConsumerConfigurations, customParameterResolvers, defaultConsumerConfigurations, defaultResponseMapper, documentSerializer, forwardingWebConsumer, generalBatchInterceptors, highPrioDispatchInterceptors, highPrioHandlerDecorators, identityProvider, lowPrioDispatchInterceptors, lowPrioHandlerDecorators, makeApplicationInstance, messageRoutingInterceptor, propertySource, relationshipsCache, schedulingInterceptor, serializer, snapshotSerializer, taskScheduler, userProvider, webResponseMapper
-
Method Details
-
configureDefaultConsumer
FluxzeroBuilder configureDefaultConsumer(MessageType messageType, UnaryOperator<ConsumerConfiguration> updateFunction) Update the default consumer configuration for the specified message type. -
addConsumerConfiguration
FluxzeroBuilder addConsumerConfiguration(ConsumerConfiguration consumerConfiguration, MessageType... messageTypes) Adds a specific consumer configuration for one or more message types. -
addBatchInterceptor
Registers aBatchInterceptorthat applies to the given message types. -
addDispatchInterceptor
default FluxzeroBuilder addDispatchInterceptor(DispatchInterceptor interceptor, MessageType... forTypes) Adds aDispatchInterceptorthat modifies or monitors message dispatch. Shortcut for highPriority = false. -
addDispatchInterceptor
FluxzeroBuilder addDispatchInterceptor(DispatchInterceptor interceptor, boolean highPriority, MessageType... forTypes) Adds aDispatchInterceptorfor specified message types with optional priority. -
addHandlerInterceptor
default FluxzeroBuilder addHandlerInterceptor(HandlerInterceptor interceptor, MessageType... forTypes) Adds aHandlerInterceptorfor given message types. -
addHandlerInterceptor
default FluxzeroBuilder addHandlerInterceptor(HandlerInterceptor interceptor, boolean highPriority, MessageType... forTypes) Adds aHandlerInterceptorwith specified priority. -
addHandlerDecorator
Adds aHandlerDecoratorfor the given message types. -
addHandlerDecorator
FluxzeroBuilder addHandlerDecorator(HandlerDecorator decorator, boolean highPriority, MessageType... forTypes) Adds aHandlerDecoratorwith control over priority. -
replaceMessageRoutingInterceptor
Replaces the default routing interceptor used for message dispatch. -
replaceCache
Replaces the default cache implementation. -
forwardWebRequestsToLocalServer
Forwards incomingMessageType.WEBREQUESTmessages to a locally running HTTP server on the specified port.This allows applications to handle web requests using their own HTTP server rather than Fluxzero’s message-based
@HandleWebinfrastructure.Note: This feature pushes requests to the local server and bypasses Fluxzero's pull-based dispatch model. Its use is discouraged unless integration with an existing HTTP stack is required.
- Parameters:
port- the port on which the local HTTP server is listening- Returns:
- this builder instance
- See Also:
-
forwardWebRequestsToLocalServer
FluxzeroBuilder forwardWebRequestsToLocalServer(LocalServerConfig localServerConfig, UnaryOperator<ConsumerConfiguration> consumerConfigurator) Configures forwarding ofMessageType.WEBREQUESTmessages to a local HTTP server using the specifiedLocalServerConfigand custom consumer configuration.This mechanism is useful for advanced integration scenarios but bypasses Fluxzero's pull-based message tracking. Prefer native
@HandleWebhandlers when possible.- Parameters:
localServerConfig- configuration for the local server (e.g., port, error behavior)consumerConfigurator- function to customize the underlyingConsumerConfiguration- Returns:
- this builder instance
- See Also:
-
replaceDefaultResponseMapper
Replaces the default response mapper used for generic result mapping. -
replaceWebResponseMapper
Replaces theWebResponseMapperused for handling web responses. -
replaceTaskScheduler
Replaces the defaultTaskSchedulerimplementation. -
withAggregateCache
Configures a dedicated cache for a specific aggregate type. -
replaceRelationshipsCache
Replaces the internal relationships cache with a new implementation. -
replaceIdentityProvider
Replaces the identity provider used to generate message and entity identifiers. -
addParameterResolver
FluxzeroBuilder addParameterResolver(ParameterResolver<? super DeserializingMessage> parameterResolver) Registers aParameterResolverto support injection of method arguments in handlers. -
replaceSerializer
Replaces the default serializer used for events, commands, snapshots, and documents. -
replaceCorrelationDataProvider
FluxzeroBuilder replaceCorrelationDataProvider(UnaryOperator<CorrelationDataProvider> correlationDataProvider) Replaces theCorrelationDataProviderused to attach correlation data to messages. -
replaceSnapshotSerializer
Overrides the serializer used specifically for snapshot serialization. -
replaceDocumentSerializer
Replaces the document serializer for search indexing. -
registerUserProvider
Registers a user provider used for resolving and authenticatingUserinstances. -
addPropertySource
Adds aPropertySourceto the configuration chain. -
replacePropertySource
Replaces the existing property source. -
disableErrorReporting
FluxzeroBuilder disableErrorReporting()Disables automatic error reporting (e.g., viaErrorGateway). -
disableShutdownHook
FluxzeroBuilder disableShutdownHook()Prevents registration of a shutdown hook. -
disableMessageCorrelation
FluxzeroBuilder disableMessageCorrelation()Disables automatic message correlation. -
disablePayloadValidation
FluxzeroBuilder disablePayloadValidation()Disables payload validation. -
disableDataProtection
FluxzeroBuilder disableDataProtection()Disables security filtering based on@FilterContent. -
disableAutomaticAggregateCaching
FluxzeroBuilder disableAutomaticAggregateCaching()Disables automatic caching of aggregates. -
disableScheduledCommandHandler
FluxzeroBuilder disableScheduledCommandHandler()Prevents installation of the default scheduled command handler. -
disableAutomaticTracking
Helper method that disables all processes that contain automatic trackers. Useful for low-level applications that want to run as lean as possible.E.g., this disables the scheduled command handler and automatic entity caching.
-
disableTrackingMetrics
FluxzeroBuilder disableTrackingMetrics()Disables tracking of processing metrics. -
disableCacheEvictionMetrics
FluxzeroBuilder disableCacheEvictionMetrics()Disables metrics related to cache eviction. -
disableWebResponseCompression
FluxzeroBuilder disableWebResponseCompression()Disables compression for web responses. -
disableAdhocDispatchInterceptor
FluxzeroBuilder disableAdhocDispatchInterceptor()Disables support for dynamically injected dispatch interceptors. -
makeApplicationInstance
Marks the built instance as the global (application-level)Fluxzero. -
disableKeepalive
FluxzeroBuilder disableKeepalive()Disables Fluxzero’s built-in keepalive mechanism.By default, a Fluxzero instance keeps the JVM running after it is built by maintaining a single non-daemon thread. Calling this method disables that behavior, allowing the application to terminate normally once the main thread finishes.
-
build
-