Skip to content

AsynchronousCommandBus not properly supported #99

@CodeDrivenMitch

Description

@CodeDrivenMitch

We have gotten reports from a client that aggregates are not properly reported when using an AsynchronousCommandBus.

To quote:

i think i found the problem why nothing is reported about our aggregate instances.

AxonServerCommandBus -> spanFactory.createHandleCommandSpan(CommandBus.handleDistributedCommand) -> NOOP
localSegment -> spanFactory.createDispatchCommandSpan -> MeasuringConsoleSpan(CommandBus.dispatchCommand)
localSegment -> spanFactory.createHandleCommandSpan(CommandBus.handleCommand) -> NOOP
 
Our „localSegment" is actually an instance of „AsynchronousCommandBus".
So the span is created and started at step 2 for Thread A, but step 3 is executed on Thread B. Therefore, no message id is attached to Thread B and „AxoniqConsoleHandlerEnhancerDefinition"
can not register information on span about the handler being invoked. In addition, the span started at step 2 closes before step 3 completes.
This does not happen when using „SimpleCommandBus" as localSegment for AxonServerCommandBus, because step 2 and 3 are then invoked on the same thread.
I will check if we can easily change to SimpleCommandBus for localSegment.

We should find a way to attach the message id to the thread in the AsynchronousCommandBus

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions