0
votes

We are running JHipster microservice architecture using consul for service discovery. We have one micro service which connects to a docker instance of mongodb. While testing with the stock angular ui to save a new entity, we found that disabling the database does not throw an error in the UI. From the consul ui, I can see that the service is failing 1 of 2 health checks which will pass again when I re-enable the db.

In the gateway logs, I have the following: Caused by: com.netflix.client.ClientException: Load balancer does not have available server for client: import

I assume that consul is refusing to make the service available to gateway, but it seems there should be some way to configure how gateway handles requests to unavailable services. Can anyone tell me where to look for this?

1

1 Answers

1
votes

This is normal. The gateway will only route requests to services that pass all consul healthchecks.

Note that by default Spring Boot automatically configure a healtcheck for your database. It is located at the /management/health endpoint of your microservice.

You could configure Consul health checks with the spring.cloud.consul keys of your microservice. I don't remember the specific ones but if you use IDEA it will autocomplete the available properties...