amazon-archives / amazon-kinesis-connectors

Apache License 2.0
326 stars 190 forks source link

ITransformer: Using java.lang.Exception instead of IOException #46

Open darkcrawler01 opened 9 years ago

darkcrawler01 commented 9 years ago

Hi

I feel that defining toClass & fromClass to throw IOException is very constraining. In case, I am performing some validation and want to throw some custom Exception I cannot do that. Also the KinesisConnectorRecordProcessor only handles IOExceptions, its even handle any other Runtime Exceptions that may occur. This is not a valid reason to stop processing the rest of the records. Hence I request you to change the use java.lang.Exception or at the very least use RuntimeExceptions instead everywhere

workanandr commented 9 years ago

I second this request. Recently, in my application, the worker went into an infinite loop due to this issue. A non-IOException was thrown due to a data processing error and because of the above issue, the RecordProcessor never checkpointed the record. So it kept processing the same record over and over again. I had to catch all exceptions in my code and throw an "IOException" to get past this issue. I used kinesis-connectors version 1.1.2.