Hi, I am using Axon Server as the central messaging platform for my microservices and I need the ability to configure multiple contexts easily. Right now I have to programmatically create a new AxonServerConfiguration for each context and then pass that to all of the other Axon Artifacts my app requires (e.g. event store, query bus, etc). Are there any plans to allow for this to be something configurable via the application.properties file in a future release? If so, any time frame on that release?
-Ben
Hi Ben,
The following GitHub features provides an easier API to support multi-context within a given Axon client/application.
Note that the linked PR does not make this auto configurable through Application properties at all.
Instead, you will have to define a TargetContextResolver, within which you specify to which context a given Command or Query is targeted towards.
From an Event Handling perspective, you can now stream events from distinct contexts, by using the AxonServerEventStore#createStreamableMessageSourceForContext(String)
method.
This will give you a StreamableMessageSource, which you can specify for a TrackingEventProcessor.
All this is scheduled for Axon release 4.2, which should be coming very shortly.
Sadly, I am not able to give you a more specific time frame than that, so please stay tuned.
Hope this sheds some light on the situation.
Cheers,
Steven