java.lang.Object
org.axonframework.messaging.eventhandling.processing.streaming.segmenting.annotation.SegmentParameterResolverFactory
All Implemented Interfaces:
ParameterResolverFactory

public class SegmentParameterResolverFactory extends Object implements ParameterResolverFactory
Implementation of a ParameterResolverFactory that resolves the Segment from the ProcessingContext whenever it's available.

A streaming event processor places the Segment currently being handled in the context under Segment.RESOURCE_KEY, so a handler method may declare a Segment parameter to learn which segment it is processing -- for example to key segment-scoped state or address a segment-specific collaborator.

The resolver always matches (so a handler declaring a Segment parameter is never silently skipped) and resolves to null when no Segment is present (a processor that is not aware of segments, such as a subscribing processor). A null Segment is harmless to receive, so this resolver does not fail when one is absent.

Since:
5.3.0
Author:
Allard Buijze
  • Constructor Details

    • SegmentParameterResolverFactory

      public SegmentParameterResolverFactory()
  • Method Details