It's no possible to restart the instance within the handler. You would
rather just set a flag and test this flag in the main thread regularly.
If the flag is set, stop the current running instance, create a new one
and restart the new one.
Skipping over a record is not easily possible. It also depends on the
error type. If you need to skip over messages, you can insert a
transform() as first operator and configure the Transformer with the
offset you want to skip. The transformer can access record offset via
the provided context from init() and thus skip over the bad record.
Hope this helps
-Matthias
On 10/24/17 5:35 AM, Jay Prakash Meena wrote:
> Hi Damian/Francesco
>
> Just the same doubt, Did we got a workaround for this ?
> /*
> */
> /*Is it possible to restart a new stream instance inside
> KafkaStreams.setUncaughtExceptionHandler(..) skipping the offset that
> rises the error?
> */
>
> Thanks
>
> On Monday, November 28, 2016 at 3:50:42 PM UTC+5:30, Francesco Nobilia
> wrote:
>
> Thank you Damian for your prompt replay.
>
> Is it possible to restart a new stream instance inside
> KafkaStreams.setUncaughtExceptionHandler(..) skipping the offset
> that rises the error?
>
> For example:
> /streamTypeA/
> .filter(..)
> ....
> .setUncaughtExceptionHandler( *if*(error) *then* restart
> /streamTypeA/ one offset ahead of the current one).
> * checking whether the incoming data respects the expected
> format inside a *filter() function*
> * embedding my stream inside a try/catch block. In this
> case, how can I restart my streams skipping the offset
> the caused the error?
>
> Are these solutions correct? or is there a better way to
> handle this situation?
>
> However, I'm looking for a solution to handle exceptions in
> general. I checked the confluent guide for kafka streams,
> but I didn't find anything about exception handling. How
> should I manage exceptions inside a kafka streams application?
>
> Thank you in advance for your help.
>
> Kind Regards,
>
> Francesco
>
> --
> You received this message because you are subscribed to the
> Google Groups "Confluent Platform" group.
> To unsubscribe from this group and stop receiving emails
> from it, send an email to
>
confluent-platf...@googlegroups.com.
> <
https://groups.google.com/d/msgid/confluent-platform/6b8e2a53-e76f-4297-af17-c02a31f35644%40googlegroups.com?utm_medium=email&utm_source=footer>.
> <
https://groups.google.com/d/optout>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Confluent Platform" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
confluent-platf...@googlegroups.com
> <mailto:
confluent-platf...@googlegroups.com>.
> <mailto:
confluent...@googlegroups.com>.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/confluent-platform/8f668d21-9f82-41d7-af14-adbf74da2a86%40googlegroups.com
> <
https://groups.google.com/d/msgid/confluent-platform/8f668d21-9f82-41d7-af14-adbf74da2a86%40googlegroups.com?utm_medium=email&utm_source=footer>.