Communication between microservices - request data : <p>I am dealing with communication between microservices.</p>

<p>For example (<em>fictive example, just for the illustration</em>):</p>

<ul>
<li><strong>Microservice A - Store Users (getUser, etc.)</strong></li>
<li><strong>Microservice B - Store Orders (createOrder, etc.)</strong></li>
</ul>

<p>Now if I want to add new Order from the Client app, I need to know user address. So the request would be like this:</p>

<p><strong>Client -> Microservice B (createOrder for userId 5) -> Microservice A (getUser with id 5)</strong></p>

<p>The microservice B will create order with details (address) from the User Microservice.</p>

<p><strong>PROBLEM TO SOLVE:</strong> How effectively deal with communication between microservice A and microservice B, as we have to wait until the response come back?</p>

<p><strong>OPTIONS:</strong></p>

<ul>
<li>Use RestAPI,</li>
<li>Use AMQP, like RabbitMQ and deal with this issue via RPC. (<a href="https://www.rabbitmq.com/tutorials/tutorial-six-dotnet.html" rel="noreferrer">https://www.rabbitmq.com/tutorials/tutorial-six-dotnet.html</a>)</li>
</ul>

<p>I don't know <strong>what will be better for the performance</strong>. Is call faster via RabbitMQ, or RestAPI? <strong>What is the best solution for microservice architecture</strong>?</p>
