We are planning to introduce both, pub-sub and request-reply communication models to our micriservices architecture. Both communication models are needed.
One of the solutions could be using RabbitMQ as it can provide both models and provide HA, clusterring ang other interesting features.
RabbitMQ request-reply model requires using queues, both for input and for output messages. Only one service can read from the input queue and this increases coupling.
Is there any other recommended solution for using both request-reply and pub-sub communication models in the same system? Does service mesh could be a better option?
It shall be suppoered by node.js, python and. Net CORE.
Thank you for your help
My preference would be to have
RESTapi forrequest-replypattern. This is specially applicable for internal microservices where you are in control of communication mechanism. I don't understand your comment about why they are not scalable if you defined them as properly and you can scale out and down the number of instances for the services based on demand. Be itKafka,RabbitMQ, or any other broker, I don't think they are developed forrequest-replyas primary use case. And don't forget that whatever broker you are using, if it isA->B->Cin REST, it will beA->broker->B->broker->C->broker->Aand broker need to do it house keeping.Then for pub-sub, I would use
Kafkaas it is unified model which can support pub-sub as well as point to point.But if you still wanted to use a broker for request-reply, I would check
Kafkaas it can scale massively via partitions and lot of near real streaming applications are built using that. So It could be near the minimal latency requirement ofrequest-replypattern. But then I would want a framework on top of that to associate request and replies. So I would consider using Spring Kafka to achieve that