Class ConsumerConfiguration

java.lang.Object
io.fluxzero.sdk.tracking.ConsumerConfiguration
All Implemented Interfaces:
Substitutable<ConsumerConfiguration>

public class ConsumerConfiguration extends Object implements Substitutable<ConsumerConfiguration>
Configuration class that defines how a message consumer behaves during message tracking and handler invocation.

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 Details

    • UNCONFIGURED_HANDLER_CONSUMER_MODE_PROPERTY

      public static final String UNCONFIGURED_HANDLER_CONSUMER_MODE_PROPERTY
      Chooses how unconfigured tracking handlers are assigned to default consumers.

      Supported values are PER_HANDLER_CONSUMER_MODE and DEFAULT_APP_CONSUMER_MODE. When absent, Fluxzero derives the default from ApplicationProperties.DEFAULTS_VERSION_PROPERTY.

      See Also:
    • PER_HANDLER_CONSUMER_MODE

      public static final String PER_HANDLER_CONSUMER_MODE
      Creates an isolated default consumer per unconfigured handler class.
      See Also:
    • DEFAULT_APP_CONSUMER_MODE

      public static final String DEFAULT_APP_CONSUMER_MODE
      Assigns unconfigured handlers to the shared default application consumer for their message type.
      See Also:
    • MAX_FETCH_BYTES_PROPERTY

      public static final String MAX_FETCH_BYTES_PROPERTY
      Configures the default serialized payload byte limit per tracking fetch. Consumers can override this default with
      invalid reference
      Builder#maxFetchBytes(long)
      or Consumer.maxFetchBytes().
      See Also:
    • DEFAULT_MAX_FETCH_BYTES

      public static final long DEFAULT_MAX_FETCH_BYTES
      Default serialized payload byte limit per tracking fetch.
      See Also:
    • USE_DEFAULT_MAX_FETCH_BYTES

      public static final long USE_DEFAULT_MAX_FETCH_BYTES
      Sentinel 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

    • substituteProperties

      public ConsumerConfiguration substituteProperties()
      Description copied from interface: Substitutable
      Replaces placeholders in the properties of the current resource with resolved values from application properties and returns a new instance of type T.
      Specified by:
      substituteProperties in interface Substitutable<ConsumerConfiguration>
      Returns:
      a new instance of the resource with substituted properties.
    • ordered

      public ConsumerConfiguration ordered()
      Returns a copy with consumer-specific interceptors ordered by Order.
    • conditionallyExclusive

      public boolean conditionallyExclusive()
    • exclusivityPriority

      public int exclusivityPriority(Long index)
    • configurations

      public static Stream<ConsumerConfiguration> configurations(Collection<Class<?>> handlerClasses)
      Returns a stream of ConsumerConfigurations by inspecting the given handler classes and their packages. Includes both class-level and package-level @Consumer annotations.