Class CheckpointTriggerParameterResolverFactory

java.lang.Object
io.axoniq.framework.messaging.eventstreaming.checkpoint.CheckpointTriggerParameterResolverFactory
All Implemented Interfaces:
ParameterResolverFactory

@Internal public class CheckpointTriggerParameterResolverFactory extends Object implements ParameterResolverFactory
A ParameterResolverFactory constructing a ParameterResolver resolving the CheckpointTrigger for the segment currently being handled.

This is the additive convenience that lets a self-checkpointing event handler declare a CheckpointTrigger parameter and call requestCheckpoint directly, instead of retaining the trigger handed to it through Checkpointing.onSegmentClaimed(org.axonframework.messaging.eventhandling.processing.streaming.segmenting.Segment, CheckpointTrigger).

Expects the CheckpointTrigger to reside in the ProcessingContext under CheckpointTrigger.RESOURCE_KEY. A streaming event processor places it there per batch whenever it has at least one Checkpointing component. The trigger is segment-scoped: it is shared by every handler in that processor on the claimed segment, not restricted to the checkpointing component(s). A requested checkpoint therefore applies to all the processor's components on that segment.

Important: a CheckpointTrigger is not available to every handler. The resolver always matches (so the handler is never silently skipped), but if no trigger is present when the parameter is resolved it fails the handler invocation with a descriptive IllegalStateException rather than passing null. A CheckpointTrigger parameter is therefore only usable on a handler running in a streaming event processor that has at least one Checkpointing component; declaring it on a handler that may run in a subscribing or otherwise non-checkpointing processor, or in a processor with no checkpointing component at all, will raise that exception at runtime.

Internal API. This factory is marked Internal: it is part of the self-checkpointing support, which is currently intended primarily for internal and advanced use and whose shape may change in a minor or patch release.

Since:
5.3.0
Author:
Allard Buijze