Skip to content

Introduce TargetContextResolver decorator around CommandBusConnector #3629

@smcvb

Description

@smcvb

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.

Metadata

Metadata

Assignees

Labels

Priority 2: ShouldHigh priority. Ideally, these issues are part of the release they’re assigned to.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions