Class DefaultEventProcessorSpanFactory.Builder

java.lang.Object
org.axonframework.messaging.eventhandling.tracing.DefaultEventProcessorSpanFactory.Builder
Enclosing class:
DefaultEventProcessorSpanFactory

public static class DefaultEventProcessorSpanFactory.Builder extends Object
Builder class to instantiate a DefaultEventProcessorSpanFactory. The default values are:
  • disableBatchTrace defaults to false
  • distributedInSameTrace defaults to false
  • distributedInSameTraceTimeLimit defaults to 2 minutes
The spanFactory is a required field and should be provided.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • spanFactory

      public DefaultEventProcessorSpanFactory.Builder spanFactory(SpanFactory spanFactory)
      Sets the SpanFactory to use to create the spans. This is a required field.
      Parameters:
      spanFactory - The SpanFactory to use to create the spans.
      Returns:
      The current Builder instance, for fluent interfacing.
    • disableBatchTrace

      public DefaultEventProcessorSpanFactory.Builder disableBatchTrace(boolean disableBatchTrace)
      Sets whether batch tracing should be disabled. Defaults to false. 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 a StreamingEventProcessor should be traced in the same trace as the trace that published it. Defaults to false. If true, this duration defaults to 2 minutes, which you can adjust using distributedInSameTraceTimeLimit(Duration).
      Parameters:
      distributedInSameTrace - Whether events handled by a StreamingEventProcessor should 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 a StreamingEventProcessor to be traced in the same trace as the trace that published it. Defaults to 2 minutes. Only used when distributedInSameTrace(boolean) is true.
      Parameters:
      distributedInSameTraceTimeLimit - The time limit for events handled by a StreamingEventProcessor to 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 a DefaultEventProcessorSpanFactory as specified through this Builder.
      Returns:
      The DefaultEventProcessorSpanFactory as specified through this Builder.