Flink Error/Exception Handling

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Flink Error/Exception Handling

raikarsunil
Hi,

Scenario :

I am reading data from Kafka.The FlinkKafkaConsumer reads data from it . There are some application specific logic to check if the data is valid/in-valid. When i receive an invalid message i am throwing an custom Exception and it's handled in that class. But the problem is,the flink always try to read the same invalid message and the job keeps on restarting.

Can any one let me know how can the error/exception handling be done without the flink job breaking?

Thanks,
Sunil
Cheers,
Sunil Raikar
Reply | Threaded
Open this post in threaded view
|

Re: Flink Error/Exception Handling

Tzu-Li (Gordon) Tai
Hi Sunil,

There’s recently some effort in allowing `DeserializationSchema#deserialize()` to return `null` in cases like yours, so that the invalid record can be simply skipped instead of throwing an exception from the deserialization schema.
Here are the related links that you may be interested in:

This means, however, that this isn’t available until Flink 1.3.
For the time being, a possible workaround with dealing with invalid records is explained by Robert in the first comment of https://issues.apache.org/jira/browse/FLINK-3679.

Cheers,
Gordon


On March 3, 2017 at 9:15:40 PM, raikarsunil ([hidden email]) wrote:

Hi,

Scenario :

I am reading data from Kafka.The FlinkKafkaConsumer reads data from it .
There are some application specific logic to check if the data is
valid/in-valid. When i receive an invalid message i am throwing an custom
Exception and it's handled in that class. But the problem is,the flink
always try to read the same invalid message and the job keeps on restarting.

Can any one let me know how can the error/exception handling be done without
the flink job breaking?

Thanks,
Sunil



-----
Cheers,
Sunil Raikar
--
View this message in context: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/Flink-Error-Exception-Handling-tp12029.html
Sent from the Apache Flink User Mailing List archive. mailing list archive at Nabble.com.