Class Tracker

java.lang.Object
io.fluxcapacitor.javaclient.tracking.Tracker

public class Tracker extends Object
Represents the client-side tracking context during message consumption in Flux Capacitor.

This Tracker is used locally in a Flux client to provide filtering and stateful context when consuming message batches. It is automatically set as a thread-local variable for the duration of batch processing, allowing handlers and other logic to access it via current().

See Also:
  • Field Details

    • current

      public static final ThreadLocal<Tracker> current
      Thread-local variable that holds the current tracker instance. This is automatically set by the Flux client.
  • Constructor Details

    • Tracker

      public Tracker()
  • Method Details

    • current

      public static Optional<Tracker> current()
      Returns the current tracker instance, if any.
    • getName

      public String getName()
      Returns the name of the consumer associated with this tracker.
    • canHandle

      public boolean canHandle(DeserializingMessage message, String routingKey)
      When the consumer is configured with ignoreSegment=true, segment filtering is performed client-side. This method uses the current MessageBatch to determine whether a given message should be processed by the current tracker, based on:
      • The segment range of the batch
      • The index of the message relative to the current Position
      Parameters:
      message - The message to check
      routingKey - The routing key to base the check on