Hi, Murlio,

I found https://issues.apache.org/jira/browse/KAFKA-7970, which sounds like
the answer is currently "yes". Unfortunately, it is still tricky to handle
this case, although the situation may improve soon.

In the mean time, you can try to work around it with the StateListener.
When Streams has a successful start-up, you'll see it transition from
REBALANCING to RUNNING, so if you see it transition to PENDING_SHUTDOWN,
NOT_RUNNING, or ERROR before you see "oldState: REBALANCING && newState:
RUNNING", you know that Streams did not have a successful startup. It
sounds like you can't determine programmatically *why* this happened, but
you can log a warning or error and then create a new the KafkaStreams
object and try starting it again.

I hope this helps, and feel free to comment on that ticket to add your own
perspective to the issue!

Thanks,
-John

On Fri, Mar 22, 2019 at 3:25 PM Murilo Tavares <murilo...@gmail.com> wrote:

> Hi
> After some research, I've come to a few discussions, and they all tell me
> that Kafka Streams require the topics to be created before starting the
> application.
> Nevertheless, I'd like my application to keep retrying if a topic does not
> exist.
> I've seen this thread:
> https://groups.google.com/forum/#!topic/confluent-platform/nmfrnAKCM3c,
> which is pretty old, and I'd like to know if it's still hard to catch that
> Exception in my app.
>
> Thanks
> Murilo
>

Reply via email to