Don’t try to create responses

Attempting to create responses for asynchronous calls is extremely complex to maintain. If the domain always has to return a complete response, it is a signal that its microservices should not work with asynchronous messages.

The attempt to create a request/response template with asynchronous messages breaks the asynchronous messaging design pattern template.

Creating a request/response in asynchronous messaging means that an ID template must be implemented for each message received and that this must compose a queue in another part of the broker, making the pub/sub a two-way path. This makes complexity, which of course if not simple, will grow even more.

Get Microservice Patterns and Best Practices now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.