Class DefaultSnapshotterSpanFactory.Builder

java.lang.Object
org.axonframework.eventsourcing.DefaultSnapshotterSpanFactory.Builder
Enclosing class:
DefaultSnapshotterSpanFactory

public static class DefaultSnapshotterSpanFactory.Builder extends Object
Builder class to instantiate a DefaultSnapshotterSpanFactory. The default values are:
  • separateTrace defaults to true
  • aggregateTypeInSpanName defaults to true
The spanFactory is a required field and should be provided.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • spanFactory

      public DefaultSnapshotterSpanFactory.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.
    • separateTrace

      public DefaultSnapshotterSpanFactory.Builder separateTrace(boolean separateTrace)
      Sets whether the creation of the snapshot should be represented by a separate trace. Defaults to false.

      By default, the creation of the snapshot is part of the same trace as the scheduling of the snapshot. This happens by default in the framework as well, as snapshots are created after command invocation in the current thread. If you configure the Snapshotter to create snapshots in a separate thread, you might want to set this to true. The new root trace will be linked to the parent trace so it can be correlated.

      Parameters:
      separateTrace - Whether the creation of the snapshot should be represented by a separate trace.
      Returns:
      The current Builder instance, for fluent interfacing.
    • aggregateTypeInSpanName

      public DefaultSnapshotterSpanFactory.Builder aggregateTypeInSpanName(boolean aggregateTypeInSpanName)
      Whether the aggregate type should be included in the span name. Defaults to true.
      Parameters:
      aggregateTypeInSpanName - Whether the aggregate type should be included in the span name.
      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 DefaultSnapshotterSpanFactory as specified through this Builder.
      Returns:
      The DefaultSnapshotterSpanFactory as specified through this Builder.