Regarding Multiple instances in AXON

Hi all,

How to bring 2 instances for same application in AXON framework.

Regards,
Javalkar

Just launch another instance of your application.

Then check the ‘Overview’ page on the axon server dashboard. I’ve copied an image from https://blog.nebrass.fr/playing-with-cqrs-and-event-sourcing-in-spring-boot-and-axon/ below:

axon-server-app.png

With two applications launched it should say ‘2 instances’ instead of 1 - but you get the idea.

Regards,
vab2048

If you use the contents of the “Running AxonServer” repository and put the axonserver.jar file in its root:

$ cd 1-local/1-first-up-se
$ nohup ./startup.sh &

[1] 3864
nohup: ignoring input and appending output to 'nohup.out’
$

Open a browser to “http://localhost:8024” and go to the “Overview” tab. Now start two quicktesters:

$ SPRING_PROFILES_ACTIVE=axonserver MS_DELAY=10000 java -jar …/…/axonserver-quicktest/axonserver-quicktest.jar &
[1] 3874

$ SPRING_PROFILES_ACTIVE=axonserver MS_DELAY=10000 java -jar …/…/axonserver-quicktest/axonserver-quicktest.jar &
[1] 3874
$

You should now see:
Untitled.png

If you are using a platform like Kubernetes, you could use a Deployment and scale your app at will. As long as the “axon.axonserver.servers” property points at the correct hostname, or you use an environment variable “AXON_AXONSERVER_SERVERS”, your app should be able to find AxonServer.

Cheers,
Bert Laverman