michelin / kstreamplify

Kstreamplify is a Java library that brings new features on top of Kafka Streams.
Apache License 2.0
98 stars 17 forks source link

Add retries on exception handler #34

Open loicgreffier opened 1 year ago

loicgreffier commented 1 year ago

Some production error or deserialization error can be retriable.

The production error handler and the deserialization error handler should handle these errors.

mlmomplot commented 11 months ago

@loicgreffier I am thinking for deserialization this issue is corrected by this PR : https://github.com/michelin/kstreamplify/pull/75

For production, I think we check if the exception is retriable.

BUT, linked to the issue: how to treat InvalidPidMappingException? when we have that the record is not produced. If we catch it into the production exception handler and return ProductionExceptionHandlerResponse.FAIL, the stream is restarted, a new producer id and a new transactional is assigned, and the stream re-attempt to produce. We can discuss about it during a meeting 😉 and may be open the debate on other Invalid Exception like InvalidProducerEpochException 😉