DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
...
Over time, certain exceptions and methods within the Kafka Streams exception handling interfaces have been deprecated are unused 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 deprecation and removal of these specific deprecated exceptions and methods to streamline the API BrokerNotFoundException 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:BrokerNotFoundException which is unused since Kafka Streams 2.8.
This change goes in two steps
...
Step2: remove the deprecated exception and the other methods already marked deprecated in the next major release which can be 5.0
...
org.apache.kafka.streams.errors.BrokerNotFoundException
Deprecated Methods for Removal:
org.apache.kafka.streams.errors.DefaultProductionExceptionHandler.handle(final ProducerRecord<byte[], byte[]> record, final Exception exception)and the interface methodorg.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 unused since in Kafka Streams 2.8.
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.
Compatibility, Deprecation, and Migration Plan
- Compatibility: This change is not backward compatible at the source code level for users who are still using the
BrokerNotFoundExceptionclass or implementing/calling these specific deprecated methods. - Deprecation: The
BrokerNotFoundExceptionwas usused unused since Kafka Streams version 2.8. The listed methods were deprecated in KafkaStreams version 3.9.- Given that these elements were deprecated in earlier versions (2.8 and 3.9), a sufficient deprecation period has passedBrokerNotFoundException is unused, we can mark it deprecated in 4.2, making their removal appropriate in 5.0 as sufficient deprecation period will be passed.
- Migration Plan:
- For
BrokerNotFoundException: Users should remove any handling of this exception asBrokerNotFoundExceptionas it is no longer relevant.For deprecated methods: Users are advised to migrate their code to use the non-deprecatedhandlemethods that acceptErrorHandlerContext. For example: - Instead of
DeserializationExceptionHandler.handle(ProcessorContext, ConsumerRecord, Exception), useDeserializationExceptionHandler.handle(ErrorHandlerContext, ConsumerRecord, Exception). - Instead of
ProductionExceptionHandler.handle(ProducerRecord, Exception), useProductionExceptionHandler.handle(ErrorHandlerContext,ProducerRecord, Exception). Instead of
ProductionExceptionHandler.handleSerializationException(ProducerRecord, Exception), useProductionExceptionHandler.handleSerializationException(ErrorHandlerContext, ProducerRecord, Exception, SerializationExceptionOrigin). - For
Test Plan
This is a code cleanup. Existing test suite should catch any failures. Will add or update new unit tests as needed.
...