Feature Description
The CommandBusConnector as introduced in #3399 currently works for the default context only.
It would be beneficial to introduce a decorator around the CommandBusConnector that uses the TargetContextResolver to find/create the CommandBusConnector for that specific context.
The Axon Server version of this, for example, could use the AxonServerConnectionManager to construct new AxonServerCommandBusConnector instances if the TargetContextResolver returns a context for a given command that does not exist yet.
Although the sample suggests Axon Server details, I do not think this should be an Axon Server only component. The wrapper can live in the org.axonframework.commandhandling.distributed, having some form of Function<String, CommandBusConnector> to generate new CommandBusConnector instances.
This also means that the TargetContextResolver should move from the Axon Server module to the axon-messaging module.
Current Behaviour
The TargetContextResolver is not used for distributed command routing.
Wanted Behaviour
The TargetContextResolver is used as a decorator around the CommandBusConnector.
Possible Workarounds
Custom build.
Feature Description
The
CommandBusConnectoras introduced in #3399 currently works for the default context only.It would be beneficial to introduce a decorator around the
CommandBusConnectorthat uses theTargetContextResolverto find/create theCommandBusConnectorfor that specific context.The Axon Server version of this, for example, could use the
AxonServerConnectionManagerto construct newAxonServerCommandBusConnectorinstances if theTargetContextResolverreturns a context for a given command that does not exist yet.Although the sample suggests Axon Server details, I do not think this should be an Axon Server only component. The wrapper can live in the
org.axonframework.commandhandling.distributed, having some form ofFunction<String, CommandBusConnector>to generate newCommandBusConnectorinstances.This also means that the
TargetContextResolvershould move from the Axon Server module to theaxon-messagingmodule.Current Behaviour
The
TargetContextResolveris not used for distributed command routing.Wanted Behaviour
The
TargetContextResolveris used as a decorator around theCommandBusConnector.Possible Workarounds
Custom build.