Comments (6)
Hi @Fryuni, currently Azkarra exposes the /health
endpoint that returns some information about the state of all KafkaStreams
instances. In addition, it provides a basic HealthIndicator
for Kafka Streams (StreamsHealthIndicator
).
Basically, the service is considered to be:
UP
if the KafkaStreams's state isRUNNING
(/health
returned with HTTP code 200).DOWN
if the KafkaStreams's stateERROR
(/health
returned with HTTP code 503).- Otherwhise, the status for the service is set to
UNKNOWN
(/health
returned with HTTP code 200).
Internally, Azkarra encapsualtes the KafkaStreams
instance into the KafkaStreamsContainer
class which has a state()
method aware of state store recovery. Since Azkarra 0.9, the container will return the the following states during state-store recovering process: STATE_RESTORE_START
, STATE_RESTORE_IN_PROGRESS
, STATE_RESTORE_COMPLETED
.
So, to solve your issue I think you have two solutions :
-
You can implement and register an additional
HealthIndicator
that will set the status DOWN whenever the Kafka Streams state is notRUNNING
. -
You can implement and register a custom JAX-RS resource to expose your own REST endpoints for liveness and readyness. See Azkarra REST Extensions. When implementinb an extension you can get an access to the AzkarraStreamsService to retrieve all
KafkaStreamsContainer
instance.
Hope this help!
from azkarra-streams.
I just checked it out, and it seems easy to implement a custom health check. Thank you!
One more question: how to register a custom HealthIndicator
?
from azkarra-streams.
You can just annotate your class with @Component
so that the class will be registered to the AzkarraContext
. Then, the ApiHealthRoutes will look for all registered components that implement the HealthIndicator
interface to build an aggregate HealthIndicator.
from azkarra-streams.
Is there any way to register programmatically (I mean, using the builder)?
from azkarra-streams.
Yes, you can just use the AzkarraContext#registerComponent
method. Here is an example: https://github.com/streamthoughts/azkarra-streams/blob/master/azkarra-examples/src/main/java/io/streamthoughts/examples/azkarra/noannotation/StreamsApplication.java
Why don't you use the component scan mechanism ?
from azkarra-streams.
Oh, I see. We're just not a big fan of annotations :)
I'll try to implement the health check and bring some feedback.
Thanks!
from azkarra-streams.
Related Issues (20)
- Azkarra UI: tables must be sortable
- ComponentNameGenerator fails to generate component name for inner class
- ComponentScan annotation should support arguments to specify the packages to scan
- Bad configuration is provided in azkarra quickstart archetypes
- Azkarra fails to start if azkarra.context config is missing
- Declared ApplicationIdBuilder are not set to StreamExecutionEnvironment
- MapConf#keyset() throws NPE when fallback is null
- MapConf#getValue() should add fallback when returning a Conf object.
- LimitHandlers.dropHeadOnLimitReached returns the wrong implementation
- DeadLetterTopic should be automatically created
- Add Dead Letter Topic support ProductionException
- Add new interface DeadLetterTopicNameExtractor
- Improves HealthCheck to return to be aware of StreamThread status
- upgrade to kafka streams 2.8
- feat(commons): add deadLetterQueue support for StreamsUncaughtExceptionResponse
- feat(runtime): add new StreamThreadExceptionHandler to restart new StreamThread.
- feat(server): add new REST endpoint ot scale the number of stream threads.
- DefaultInteractiveQueryService has a problem when one environment has more than one container HOT 1
- How do i listen to streams state using a topology provider ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azkarra-streams.