Communication between two microservices
<p>I am creating a project with microservices architecture. And I created two microservices.</p>

<p>One of them is for product entity, the other is for bill entity. They have their own endpoints and they are connected together with the gateway (i am using jhipster microservices architecture). </p>

<p>The bill-ms should access to list of products. I'm wondering how I can communicate between those two ms. I have three approaches in my mind:</p>

<ol>
<li><p>Send a request from bill-ms to queue - like rabbitMQ, to get these products with these ids from product-ms (I don't know what is bottleneck of this)</p></li>
<li><p>Send a request to gateway for product service and get the product from there (I'm worried about the latency because of the data size between them and in this way I'm not touching the database directly so I always depend on the gateway)</p></li>
<li><p>I can duplicate the repositories, services and entities in bill-ms (it's an ugly way, and I think it breaks the rule of ms-architecture and the maintenance is very difficult)</p></li>
</ol>

<p>If you have any other approaches, I appreciate you to share it with me.</p>

<p><strong>Edit</strong></p>

<ol>
<li>Now I know what the bottleneck is: say that there are 3 instance of bill-ms and how does rabbitMQ decide which instance to respond? or how should I say to ribbon "<strong>give me the free instance of bill-ms to subscribe to the request from rabbitMQ</strong>" for load balancing.</li>
</ol>