Current state: Under Discussion
Discussion thread: here [Change the link from the KIP proposal email archive to your own email thread]
JIRA:
Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).
Over time, certain exceptions and methods within the Kafka Streams exception handling interfaces have been deprecated in favor of newer, more comprehensive alternatives. Retaining these deprecated elements can lead to confusion, and complicates future development and maintenance. This KIP proposes the removal of these specific deprecated exceptions and methods to streamline the API and improve code clarity.
The removal will affect the public exceptions of Kafka Streams. Users who are still using the BrokerNotFoundException class or implementing/calling these specific deprecated methods will encounter compilation errors.
This KIP proposes to remove the following deprecated Kafka Streams exception class and methods:
Deprecated Class for Removal:
org.apache.kafka.streams.errors.BrokerNotFoundExceptionDeprecated Methods for Removal:
org.apache.kafka.streams.errors.DefaultProductionExceptionHandler.handle(final ProducerRecord<byte[], byte[]> record, final Exception exception) and the interface method org.apache.kafka.streams.errors.ProductionExceptionHandler.handle(final ProducerRecord<byte[], byte[]> record, final Exception exception)org.apache.kafka.streams.errors.ProductionExceptionHandler.handleSerializationException(final ProducerRecord record, final Exception exception)org.apache.kafka.streams.errors.DeserializationExceptionHandler.handle(final ProcessorContext context, final ConsumerRecord<byte[], byte[]> record,final Exception exception)org.apache.kafka.streams.errors.LogAndContinueExceptionHandler.handle(final ProcessorContext context, final ConsumerRecord<byte[], byte[]> record,final Exception exception)org.apache.kafka.streams.errors.LogAndFailExceptionHandler.handle(final ProcessorContext context, final ConsumerRecord<byte[], byte[]> record, finalException exception)The BrokerNotFoundException class was deprecated in Kafka Streams 2.8 and it is no longer used internally.
The listed methods were deprecated in Kafka Streams version 3.9, with newer handle methods (that include ErrorHandlerContext) provided as replacements.
The removal of these elements will simplify the interfaces and ensure users adopt the more robust exception handling mechanisms.
BrokerNotFoundException class or implementing/calling these specific deprecated methods.BrokerNotFoundException was deprecated in Kafka Streams version 2.8. The listed methods were deprecated in KafkaStreams version 3.9.BrokerNotFoundException: Users should remove any handling of this exception as it is no longer relevant.handle methods that accept ErrorHandlerContext. For example:DeserializationExceptionHandler.handle(ProcessorContext, ConsumerRecord, Exception), use DeserializationExceptionHandler.handle(ErrorHandlerContext, ConsumerRecord, Exception).ProductionExceptionHandler.handle(ProducerRecord, Exception), use ProductionExceptionHandler.handle(ErrorHandlerContext,ProducerRecord, Exception).ProductionExceptionHandler.handleSerializationException(ProducerRecord, Exception), use ProductionExceptionHandler.handleSerializationException(ErrorHandlerContext, ProducerRecord, Exception, SerializationExceptionOrigin).This is a code cleanup. Existing test suite should catch any failures. Will add or update new unittests as needed.
N/A