Class DefaultCommandBusSpanFactory
java.lang.Object
org.axonframework.messaging.commandhandling.tracing.DefaultCommandBusSpanFactory
- All Implemented Interfaces:
CommandBusSpanFactory
Default implementation of the
CommandBusSpanFactory. Can be configured to include the command handling of a
distributed command in the same trace or not (true by default).- Since:
- 4.9.0
- Author:
- Mitchell Herrijgers
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder class to instantiate aDefaultCommandBusSpanFactory. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a newDefaultCommandBusSpanFactoryusing the providedbuilder. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a Builder to be able to create aDefaultCommandBusSpanFactory.createDispatchCommandSpan(CommandMessage commandMessage, boolean distributed) Creates a span for the dispatching of a command.createHandleCommandSpan(CommandMessage commandMessage, boolean distributed) Creates a span for the handling of a command.propagateContext(CommandMessage commandMessage) Propagates the context of the current span to the given command message.
-
Constructor Details
-
DefaultCommandBusSpanFactory
Creates a newDefaultCommandBusSpanFactoryusing the providedbuilder.- Parameters:
builder- The builder to build theDefaultCommandBusSpanFactoryfrom.
-
-
Method Details
-
createDispatchCommandSpan
Description copied from interface:CommandBusSpanFactoryCreates a span for the dispatching of a command.- Specified by:
createDispatchCommandSpanin interfaceCommandBusSpanFactory- Parameters:
commandMessage- The command message to create a span for.distributed- Whether the command is distributed or not.- Returns:
- The created span.
-
createHandleCommandSpan
Description copied from interface:CommandBusSpanFactoryCreates a span for the handling of a command.- Specified by:
createHandleCommandSpanin interfaceCommandBusSpanFactory- Parameters:
commandMessage- The command message to create a span for.distributed- Whether the command is distributed or not.- Returns:
- The created span.
-
propagateContext
Description copied from interface:CommandBusSpanFactoryPropagates the context of the current span to the given command message.- Specified by:
propagateContextin interfaceCommandBusSpanFactory- Parameters:
commandMessage- The command message to propagate the context to.- Returns:
- The command message with the propagated context.
-
builder
Creates a Builder to be able to create aDefaultCommandBusSpanFactory. The default values are:distributedCommandInSameTracedefaults totrue
spanFactoryis a required field and should be provided.- Returns:
- a Builder to be able to create a
DefaultCommandBusSpanFactory
-