Distributed Command BUS Using Spring Boot [Sample Code & Configuration Required]

I am trying to make the distributed command bus with sping boot project but could not progress much further. It would be great if someone can provide me with a sample project that will help me out. As of now when I look at the documentation for the same it says that it is yet to come (https://github.com/AxonFramework/ReferenceGuide/blob/3.0/part3/spring-boot-autoconfig.md). Any help would be appreciated.


Hi Saibal,

You first need to select the spring cloud discovery set up you’d like to use.
I’ve personally set it up by using an Eureka Server and Client.

I’m taking the stance that you’ve got an Eureka Server running and your Spring Boot application annotated with @EnableDiscoveryClient for this case.
Axon wise you’d then want to specify the DistributedCommandBus using the a SpringCloudCommandRouter(DiscoveryClient, RoutingStrategy) to route the commands to the correct client and ideally use the SpringHttpCommandBusConnector({local}-CommandBus, RestTemplate, Serializer) to send the commands.

Hoping this helps.


Thanks Steven.

I would appreciate if you can share some code-base to elaborate the same.


Hi Saibal,

I’ve just updated the Reference guide to incorporate the Spring Cloud Connector information.
It contains a short example code how you could implement this.

Cheers, Steven