Reputation: 300
Given a recently started Kafka Streams app, how can one reliably determine that it has reached the "RUNNING" state? This is in the context of a test program that launches one or more streams apps and needs to wait until they are running before submitting test messages.
I know about the .setStateListener
method but I'm wondering if there is a way of detecting this state from outside the app process. I thought it might be exposed as a jmx metric but I couldn't find one in VisualVM
Upvotes: 2
Views: 2567
Reputation: 15067
The state listener method is the way to go. There is no other out-of-the-box way to achieve what you want.
That said, you can do the following for example:
Of course, you can use other ways to communicate readiness of a Kafka Streams application. The REST endpoint idea in (1) is just one example.
Upvotes: 2