Class Tracker
java.lang.Object
io.fluxcapacitor.javaclient.tracking.Tracker
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final ThreadLocal
<Tracker> Thread-local variable that holds the current tracker instance. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
canHandle
(DeserializingMessage message, String routingKey) When the consumer is configured withignoreSegment=true
, segment filtering is performed client-side.current()
Returns the current tracker instance, if any.getName()
Returns the name of the consumer associated with this tracker.
-
Field Details
-
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
Returns the current tracker instance, if any. -
getName
Returns the name of the consumer associated with this tracker. -
canHandle
When the consumer is configured withignoreSegment=true
, segment filtering is performed client-side. This method uses the currentMessageBatch
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 checkroutingKey
- The routing key to base the check on
-