Class ConsumerConfiguration
- All Implemented Interfaces:
Substitutable<ConsumerConfiguration>
ConsumerConfiguration is used to fine-tune the behavior of message consumers beyond what is possible with the
Consumer annotation. It supports handler filtering, tracking concurrency, custom interceptors, and more.
Usage: Consumers can be declared programmatically using this configuration object, generated
automatically from @Consumer annotations on handler classes or packages, or derived from the default
consumer template for handlers without an explicit consumer.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringAssigns unconfigured handlers to the shared default application consumer for their message type.static final StringPrefix for message-type specific default handler execution mode properties.static final StringApp-wide default handler execution mode used when a consumer and its message-type default consumer both useConsumerHandlingMode.DEFAULT.static final longDefault serialized payload byte limit per tracking fetch.static final StringConfigures the default serialized payload byte limit per tracking fetch.static final StringCreates an isolated default consumer per unconfigured handler class.static final StringChooses how unconfigured tracking handlers are assigned to default consumers.static final longSentinel value for consumers that inherit the configured default max fetch byte limit. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic Stream<ConsumerConfiguration> configurations(Collection<Class<?>> handlerClasses) Returns a stream ofConsumerConfigurations by inspecting the given handler classes and their packages.static StringdefaultHandlingModeProperty(MessageType messageType) Returns the property key for a message-type specific default handler execution mode.intexclusivityPriority(Long index) ordered()Returns a copy with consumer-specific interceptors ordered byOrder.Replaces placeholders in the properties of the current resource with resolved values from application properties and returns a new instance of typeT.
-
Field Details
-
UNCONFIGURED_HANDLER_CONSUMER_MODE_PROPERTY
Chooses how unconfigured tracking handlers are assigned to default consumers.Supported values are
PER_HANDLER_CONSUMER_MODEandDEFAULT_APP_CONSUMER_MODE. When absent, Fluxzero derives the default fromApplicationProperties.DEFAULTS_VERSION_PROPERTY.- See Also:
-
PER_HANDLER_CONSUMER_MODE
Creates an isolated default consumer per unconfigured handler class.- See Also:
-
DEFAULT_APP_CONSUMER_MODE
Assigns unconfigured handlers to the shared default application consumer for their message type.- See Also:
-
MAX_FETCH_BYTES_PROPERTY
Configures the default serialized payload byte limit per tracking fetch. Consumers can override this default withorinvalid reference
Builder#maxFetchBytes(long)Consumer.maxFetchBytes().- See Also:
-
DEFAULT_HANDLING_MODE_PROPERTY
App-wide default handler execution mode used when a consumer and its message-type default consumer both useConsumerHandlingMode.DEFAULT.- See Also:
-
DEFAULT_HANDLING_MODE_BY_MESSAGE_TYPE_PROPERTY_PREFIX
Prefix for message-type specific default handler execution mode properties.For example,
fluxzero.tracking.defaultHandlingMode.webrequest = asyncchanges only web request default consumers whileDEFAULT_HANDLING_MODE_PROPERTYstill applies app-wide.- See Also:
-
DEFAULT_MAX_FETCH_BYTES
public static final long DEFAULT_MAX_FETCH_BYTESDefault serialized payload byte limit per tracking fetch.- See Also:
-
USE_DEFAULT_MAX_FETCH_BYTES
public static final long USE_DEFAULT_MAX_FETCH_BYTESSentinel value for consumers that inherit the configured default max fetch byte limit. This value is resolved before read requests are sent.- See Also:
-
-
Constructor Details
-
ConsumerConfiguration
public ConsumerConfiguration()
-
-
Method Details
-
defaultHandlingModeProperty
Returns the property key for a message-type specific default handler execution mode.- Parameters:
messageType- message type to configure- Returns:
- property key using the lowercase message type name
-
substituteProperties
Description copied from interface:SubstitutableReplaces placeholders in the properties of the current resource with resolved values from application properties and returns a new instance of typeT.- Specified by:
substitutePropertiesin interfaceSubstitutable<ConsumerConfiguration>- Returns:
- a new instance of the resource with substituted properties.
-
ordered
Returns a copy with consumer-specific interceptors ordered byOrder. -
conditionallyExclusive
public boolean conditionallyExclusive() -
exclusivityPriority
-
configurations
Returns a stream ofConsumerConfigurations by inspecting the given handler classes and their packages. Includes both class-level and package-level@Consumerannotations.
-