We are using Spring Cloud Streams with multiple bindings based on Kafka Streams binders.
The output of /actuator/health
correctly lists all our bindings and their state (RUNNING
) - see example below.
Our expectation was, when a binding is stopped using
curl -d '{"state":"STOPPED"}' -H "Content-Type: application/json" -X POST http://<host>:<port>/actuator/bindings/mystep1
,
it is still listed, but with threadState
= NOT_RUNNING
or SHUTDOWN
and the overall health status is DOWN
.
This is not the case!. After stopping a binder, it is removed from the list and the overall state of /actuator/health
is still UP
.
- Is there a reason for this? We would like to have a alert, on this execution state of our application.
- Are there code examples, how we can achieve this by a customized solution based on
KafkaStreamsBinderHealthIndicator
?
Example output of /actuator/health
with Kafka Streams:
{
"status": "UP",
"components": {
"binders": {
"status": "UP",
"components": {
"kstream": {
"status": "UP",
"details": {
"mystep1": {
"threadState": "RUNNING",
...
},
...
},
"mystep2": {
"threadState": "RUNNING",
...
},
...
}
}
}
}
},
"refreshScope": {
"status": "UP"
}
}
}
UPDATE on the exact situation:
- We do not stop the binding manually via the bindings endpoint.
- We have implemented integrated error queues for runtime errors within all processing steps based on StreamBridge.
- The solution has also some kind of circuit breaker feature. This is the one that stops a binding from within the code, when a configurable limit of consecutive runtime errors is reached, because we do not want to flood our internal error queues.
- Our application is monitored by Icinga via
/actuator/health
, therefore we would like to get an alarm, when on of the bindings is stopped. - Switching in Icinga to another endpoint like
/actuator/bindings
cannot be done easily by our team.