How to dispatch/Send a command from one microservice to other microservice connected through Axon ? Do we need to use sagas for this requirement or any alternate way to handle this? Please list the possible approaches to handle this

How to dispatch/Send a command from one microservice to other microservice connected through Axon ? Do we need to use sagas for this requirement or any alternate way to handle this? Please list the possible approaches to handle this.

Hello,

Could you give more details about your setup?

If you are using the spring cloud extension, check out the SpringCloudCommandRouter to verify if your Services properly discover each other.

If everything works configured properly and your services know about each other than the dispatching of commands remotely should work out of the box because of SpringHttpCommandBusConnector.

Make sure your security configurations allow access between services for the following endpoints:
image
image

Best of luck,
Bogdan

Tq Bogdan for the response.

But we heard like we need to use event based communication for interaction between microservices and sagas can acheive this.can u throw some light on this and how sagas r different from this springHttpCommandbusconnector. We are new to axon so please consider if its a basic question

Hello,

Those two are not related. Saga is a component responsible for coordinating the activities between different Aggregates or interacting with external services.

We also use Saga when we have a complex flow that would trigger side effects in the same aggregate to handle them better.

From what I understood in your case you are only interested in sending commands to a different micro service, this can be done as explained before using the spring cloud extension or if you use Axon Server, this should work out of the box, but I’m not sure.

To give you some advice I will need to know more about your application setup / infrastructure.

Please check these great projects:

Best,
Bogdan