Health Request Builder
Builds requests for the health endpoint.
The health endpoint provides information about the current operational status of the Horizon server. It returns three key indicators that determine whether the server is functioning properly:
Database connectivity
Stellar Core availability
Stellar Core synchronization status
The server is considered healthy when all three indicators are true.
This endpoint has no parameters - it simply returns the current health status.
Note: The health endpoint returns Content-Type: text/plain instead of application/json, so this builder handles the response parsing differently from other endpoints.
Example usage:
val server = HorizonServer("https://horizon.stellar.org")
// Get current health status
val health = server.health().execute()
if (health.isHealthy) {
println("Server is healthy")
println("Database connected: ${health.databaseConnected}")
println("Core up: ${health.coreUp}")
println("Core synced: ${health.coreSynced}")
} else {
println("Server is experiencing issues")
if (!health.databaseConnected) println("Database is not connected")
if (!health.coreUp) println("Stellar Core is not up")
if (!health.coreSynced) println("Stellar Core is not synced")
}See also
Functions
Health endpoint doesn't support cursor pagination. This method throws UnsupportedOperationException.
Build and execute request to get health status.
Health endpoint doesn't support limit parameter. This method throws UnsupportedOperationException.
Health endpoint doesn't support order parameter. This method throws UnsupportedOperationException.
Creates a Server-Sent Events (SSE) stream for this request. The stream will automatically reconnect on connection loss and resume from the last received event.