Class DefaultEventProcessorSpanFactory.Builder
java.lang.Object
org.axonframework.messaging.eventhandling.tracing.DefaultEventProcessorSpanFactory.Builder
- Enclosing class:
DefaultEventProcessorSpanFactory
Builder class to instantiate a
DefaultEventProcessorSpanFactory. The default values are:
disableBatchTracedefaults tofalsedistributedInSameTracedefaults tofalsedistributedInSameTraceTimeLimitdefaults to 2 minutes
spanFactory is a required field and should be provided.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Initializes aDefaultEventProcessorSpanFactoryas specified through this Builder.disableBatchTrace(boolean disableBatchTrace) Sets whether batch tracing should be disabled.distributedInSameTrace(boolean distributedInSameTrace) Sets whether events handled by aStreamingEventProcessorshould be traced in the same trace as the trace that published it.distributedInSameTraceTimeLimit(Duration distributedInSameTraceTimeLimit) Sets the time limit for events handled by aStreamingEventProcessorto be traced in the same trace as the trace that published it.spanFactory(SpanFactory spanFactory) Sets theSpanFactoryto use to create the spans.protected voidvalidate()Validates whether the fields contained in this Builder are set accordingly.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
spanFactory
Sets theSpanFactoryto use to create the spans. This is a required field.- Parameters:
spanFactory- TheSpanFactoryto use to create the spans.- Returns:
- The current Builder instance, for fluent interfacing.
-
disableBatchTrace
Sets whether batch tracing should be disabled. Defaults tofalse. The result will be a root span for each event message in a batch. You might lose information about actions done in the commit phase during processing of the event when set to true.- Parameters:
disableBatchTrace- Whether batch tracing should be disabled- Returns:
- The current Builder instance, for fluent interfacing.
-
distributedInSameTrace
public DefaultEventProcessorSpanFactory.Builder distributedInSameTrace(boolean distributedInSameTrace) Sets whether events handled by aStreamingEventProcessorshould be traced in the same trace as the trace that published it. Defaults tofalse. Iftrue, this duration defaults to 2 minutes, which you can adjust usingdistributedInSameTraceTimeLimit(Duration).- Parameters:
distributedInSameTrace- Whether events handled by aStreamingEventProcessorshould be traced in the same trace as the trace that published it.- Returns:
- The current Builder instance, for fluent interfacing.
-
distributedInSameTraceTimeLimit
public DefaultEventProcessorSpanFactory.Builder distributedInSameTraceTimeLimit(Duration distributedInSameTraceTimeLimit) Sets the time limit for events handled by aStreamingEventProcessorto be traced in the same trace as the trace that published it. Defaults to 2 minutes. Only used whendistributedInSameTrace(boolean)istrue.- Parameters:
distributedInSameTraceTimeLimit- The time limit for events handled by aStreamingEventProcessorto be traced in the same trace as the trace that published it.- Returns:
- The current Builder instance, for fluent interfacing.
-
validate
protected void validate()Validates whether the fields contained in this Builder are set accordingly. -
build
Initializes aDefaultEventProcessorSpanFactoryas specified through this Builder.- Returns:
- The
DefaultEventProcessorSpanFactoryas specified through this Builder.
-