Class DefaultQueryBusSpanFactory
java.lang.Object
org.axonframework.messaging.queryhandling.tracing.DefaultQueryBusSpanFactory
- All Implemented Interfaces:
QueryBusSpanFactory
Default implementation of the
QueryBusSpanFactory. Can be configured to include the query handling of a
distributed query 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 aDefaultQueryBusSpanFactory. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a newDefaultQueryBusSpanFactoryusing the providedbuilder. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a Builder to be able to create aDefaultQueryBusSpanFactory.createQueryProcessingSpan(QueryMessage queryMessage) Creates a span for processing a query.createQuerySpan(QueryMessage queryMessage, boolean distributed) Creates a span for a query.createResponseProcessingSpan(QueryMessage queryMessage) Creates a span for processing a response.createStreamingQuerySpan(QueryMessage queryMessage, boolean distributed) Creates a span for a streaming query.createSubscriptionQueryProcessUpdateSpan(SubscriptionQueryUpdateMessage updateMessage, QueryMessage queryMessage) Creates a span for processing a subscription query update that has been received from the server.createSubscriptionQuerySpan(QueryMessage queryMessage, boolean distributed) Creates a span for a subscription query.<M extends QueryMessage>
MpropagateContext(M queryMessage) Propagates the context of the current span to the givenqueryMessage.
-
Constructor Details
-
DefaultQueryBusSpanFactory
Creates a newDefaultQueryBusSpanFactoryusing the providedbuilder.- Parameters:
builder- The builder to build theDefaultQueryBusSpanFactoryfrom.
-
-
Method Details
-
createQuerySpan
Description copied from interface:QueryBusSpanFactoryCreates a span for a query.- Specified by:
createQuerySpanin interfaceQueryBusSpanFactory- Parameters:
queryMessage- The query message being dispatched.distributed- Whether the query is from a distributed source.- Returns:
- The span for the handling of the query.
-
createSubscriptionQuerySpan
Description copied from interface:QueryBusSpanFactoryCreates a span for a subscription query.- Specified by:
createSubscriptionQuerySpanin interfaceQueryBusSpanFactory- Parameters:
queryMessage- The subscription query message being dispatched.distributed- Whether the subscription query is from a distributed source.- Returns:
- The span for the handling of the subscription query.
-
createSubscriptionQueryProcessUpdateSpan
public Span createSubscriptionQueryProcessUpdateSpan(SubscriptionQueryUpdateMessage updateMessage, QueryMessage queryMessage) Description copied from interface:QueryBusSpanFactoryCreates a span for processing a subscription query update that has been received from the server.- Specified by:
createSubscriptionQueryProcessUpdateSpanin interfaceQueryBusSpanFactory- Parameters:
updateMessage- The update message being handled.queryMessage- The subscription query message that the update is for.- Returns:
- The span for the processing of the subscription query update.
-
createStreamingQuerySpan
Description copied from interface:QueryBusSpanFactoryCreates a span for a streaming query.- Specified by:
createStreamingQuerySpanin interfaceQueryBusSpanFactory- Parameters:
queryMessage- The query message being dispatched.distributed- Whether the query is from a distributed source.- Returns:
- The span for the handling of the streaming query.
-
createQueryProcessingSpan
Description copied from interface:QueryBusSpanFactoryCreates a span for processing a query. Distributed implementations can use this to create a span for the entire query processing on the handling side.- Specified by:
createQueryProcessingSpanin interfaceQueryBusSpanFactory- Parameters:
queryMessage- The query message being handled.- Returns:
- The span for the processing of the query.
-
createResponseProcessingSpan
Description copied from interface:QueryBusSpanFactoryCreates a span for processing a response. Distributed implementations can use this to create a span for the entire response processing on the sending side.- Specified by:
createResponseProcessingSpanin interfaceQueryBusSpanFactory- Parameters:
queryMessage- The query message the response is for.- Returns:
- The span for the processing of the response.
-
propagateContext
Description copied from interface:QueryBusSpanFactoryPropagates the context of the current span to the givenqueryMessage.- Specified by:
propagateContextin interfaceQueryBusSpanFactory- Type Parameters:
M- The type of the query message.- Parameters:
queryMessage- The query message to propagate the context to.- Returns:
- The query message with the context of the current span.
-
builder
Creates a Builder to be able to create aDefaultQueryBusSpanFactory. The default values are:distributedInSameTracedefaults totrue
spanFactoryis a required field and should be provided.- Returns:
- a Builder to be able to create a
DefaultQueryBusSpanFactory
-