Sending commands between two microservices

First things first, english is not my first language, therefore I’m sorry if I make any kind of gramatical mistakes, and please, feel free to tell me about them.

So the thing is, let’s say I have two microservices, Micro-A and Micro-B. I already know how to send events between them using rabbitMQ and the proper setup, the thing is, how can I send commands between microservices? Can I use rabbitMQ+CommandGateway for this? How should I configure it?

Thanks in advance.

Marc,

commands are generally more point-to-point than events (which are pub-sub). In Axon you’d use a DistributedCommandBus to distribute commands over multiple nodes. You can then use the Spring Cloud Connector or the JGroups Connector to ensure machines detect eachother and forward messages to the correct node.
Alternatively, you can just have your services send HTTP requests to eachother, which they translate to a command internally. That way, you don’t need to expose the fact that you use Axon in your “API”.

Cheers,

Allard

Thanks for the info, I’ll probably go with the HTTP requests :slight_smile:

El dijous, 9 març de 2017 11:59:58 UTC+1, Allard Buijze va escriure: