<p>You know the dependencies of some microservice from Configuration (if you uses centralized configuration).</p>
<p><strong>According to the image</strong>: As you can see, this <code>.yml</code> file (starting with <code>ms-port</code>) of configuration with multiple dependencies to other microservices.
According to the Example The <code>urlRecapcha</code> is pointing to microservices <code>ms-recaptcha</code>.</p>
<p><a href="https://i.stack.imgur.com/Ci7Jd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ci7Jd.png" alt="enter image description here" /></a></p>
<p>But, How is it possible to know which microservices consume a certain microservice?
How the dependency know its consumers?</p>
<p><strong>How the microservices <code>ms-recaptcha</code> knows that <code>ms-port</code> is its consumer?</strong></p>
<p>Is it possible?</p>

joseluisbz
<p>You can use Consumer Driven Contract approach (e.g. via Spring Cloud Contract - I'm a maintainer of that project, that's why I mention it but you can use other ones like Pact), where you store the information about which application uses which and you can generate tests out of it. You can check this part of the documentation of the Spring Cloud Contract project <a href="https://docs.spring.io/spring-cloud-contract/docs/3.1.4/reference/html/howto.html#how-to-common-repo-with-contracts" rel="nofollow noreferrer">https://docs.spring.io/spring-cloud-contract/docs/3.1.4/reference/html/howto.html#how-to-common-repo-with-contracts</a> that describes how you can create such a centralized repository that contains all the contracts for your company.</p>
