arangodb / arangodb-java-driver

The official ArangoDB Java driver.
Apache License 2.0
201 stars 93 forks source link

Provide method to check server availability in driver #359

Closed oliverlockwood closed 4 years ago

oliverlockwood commented 4 years ago

We already use the /_admin/server/availability HTTP endpoint as the healthcheck for ArangoDB containers in our deployment.

As part of migrating our microservices platform towards Kubernetes, we need to implement readiness checks for our microservices. Some of those services which make use of Arango need to consider Arango availability as part of the service readiness checks (not liveness checks). See also https://github.com/spring-projects/spring-boot/issues/23282

As such, it would be useful to be able to target the /_admin/server/availability HTTP endpoint - or have some other way of checking availability of Arango - through the driver Java interface.

In the absence of this I'm considering trying something like ArangoDatabase.getVersion() to determine availability, but that is clearly rather hacky. (If there's an alternative approach already available that you'd recommend, I'd welcome hearing about it.)

oliverlockwood commented 4 years ago

I see that the implementation provided in the https://github.com/arangodb/spring-boot-starter project uses the exact same getVersion() method, so I guess that's the approved standard after all. Good to know I guessed right.

(Unfortunately can't just use that library directly, due to https://github.com/arangodb/spring-boot-starter/issues/10; but that's tracked over there.)

Closing this issue accordingly.

oliverlockwood commented 1 year ago

For my own future reference, if nothing else: the getVersion() method returns the response from the /_admin/version REST endpoint.