Class ClaimSegment
java.lang.Object
io.fluxcapacitor.common.api.Request
io.fluxcapacitor.common.api.tracking.Read
io.fluxcapacitor.common.api.tracking.ClaimSegment
- All Implemented Interfaces:
JsonType
A request to claim a message segment for consumption in client-controlled tracking mode.
This is a specialization of Read
that registers the tracker and reserves a segment range for local message
consumption. It does not fetch messages (maxSize = 0
). Instead, it enables the client to handle message
delivery independently, for example:
Typical usage
This is used when:- The tracker wants to fetch messages from a client-side message cache
- The tracker wants to fetch messages manually from a
MessageStore
or other source - The tracker handles external messages (e.g. updates from an external API) and wants to filter those based on its assigned segment range
External source integration
In distributed systems where multiple application instances are polling external sources, usingClaimSegment
allows each instance to claim a distinct range of segments.
This enables segment-based filtering of externally received updates, preventing duplicate
processing across instances and offering a load-balanced coordination mechanism.
This approach helps replicate Flux’s load balancing capabilities for external streams, even when the external system does not support multithreaded tracking natively.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionClaimSegment
(Read read) ClaimSegment
(MessageType messageType, String consumer, String trackerId, long maxTimeout, boolean clientControlledIndex, String typeFilter, boolean filterMessageTarget, Long lastIndex, Long purgeTimeout) -
Method Summary
Methods inherited from class io.fluxcapacitor.common.api.tracking.Read
isIgnoreMessageTarget
-
Constructor Details
-
ClaimSegment
@ConstructorProperties({"messageType","consumer","trackerId","maxTimeout","clientControlledIndex","typeFilter","filterMessageTarget","lastIndex","purgeTimeout"}) public ClaimSegment(MessageType messageType, String consumer, String trackerId, long maxTimeout, boolean clientControlledIndex, String typeFilter, boolean filterMessageTarget, Long lastIndex, Long purgeTimeout) -
ClaimSegment
-