public class DefaultCommandBusSpanFactory extends Object implements CommandBusSpanFactory
CommandBusSpanFactory
. Can be configured to include the command handling of a
distributed command in the same trace or not (true by default).Modifier and Type | Class and Description |
---|---|
static class |
DefaultCommandBusSpanFactory.Builder
Builder class to instantiate a
DefaultCommandBusSpanFactory . |
Modifier | Constructor and Description |
---|---|
protected |
DefaultCommandBusSpanFactory(DefaultCommandBusSpanFactory.Builder builder)
Creates a new
DefaultCommandBusSpanFactory using the provided builder . |
Modifier and Type | Method and Description |
---|---|
static DefaultCommandBusSpanFactory.Builder |
builder()
Creates a Builder to be able to create a
DefaultCommandBusSpanFactory . |
Span |
createDispatchCommandSpan(CommandMessage<?> commandMessage,
boolean distributed)
Creates a span for the dispatching of a command.
|
Span |
createHandleCommandSpan(CommandMessage<?> commandMessage,
boolean distributed)
Creates a span for the handling of a command.
|
<T> CommandMessage<T> |
propagateContext(CommandMessage<T> commandMessage)
Propagates the context of the current span to the given command message.
|
protected DefaultCommandBusSpanFactory(DefaultCommandBusSpanFactory.Builder builder)
DefaultCommandBusSpanFactory
using the provided builder
.builder
- The builder to build the DefaultCommandBusSpanFactory
from.public Span createDispatchCommandSpan(CommandMessage<?> commandMessage, boolean distributed)
CommandBusSpanFactory
createDispatchCommandSpan
in interface CommandBusSpanFactory
commandMessage
- The command message to create a span for.distributed
- Whether the command is distributed or not.public Span createHandleCommandSpan(CommandMessage<?> commandMessage, boolean distributed)
CommandBusSpanFactory
createHandleCommandSpan
in interface CommandBusSpanFactory
commandMessage
- The command message to create a span for.distributed
- Whether the command is distributed or not.public <T> CommandMessage<T> propagateContext(CommandMessage<T> commandMessage)
CommandBusSpanFactory
propagateContext
in interface CommandBusSpanFactory
T
- The type of the payload of the command message.commandMessage
- The command message to propagate the context to.public static DefaultCommandBusSpanFactory.Builder builder()
DefaultCommandBusSpanFactory
. The default values are:
distributedCommandInSameTrace
defaults to true
spanFactory
is a required field and should be provided.DefaultCommandBusSpanFactory
Copyright © 2010–2024. All rights reserved.