ArangoDB microservice dependent on other microservice

40 Views Asked by At

I need to call one service from the other so I want to be sure it's ready before I use it. In my case, both microservices are running in the same database.

In the startup script, I would like to wait until the dependency is operational and abort if it isn't ready after a specified time. So this leads to the questions:

  1. How do I detect whether another microservice is started?
  2. What is the best approach to wait for another microservice to start.
  3. If it doesn't start what is the right way to abort starting the current microservice.

Thanks.

1

There are 1 best solutions below

0
On

Looks like it's actually easy. I set up the "provides" and "dependencies" in the respective foxx manifests. This prevents the dependent service from being mounted before the "provider" is ready to accept requests.