Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This KIP proposes to remove the following deprecated Kafka Streams exception class and methods:

This change goes in two steps

Step1: mark unused BrokerNotFoundException as deprecated in 4.2 release

Step2: remove the deprecated exception and the other methods already marked deprecated in the next major release which can be 5.0

Unused Exception for Deprecation and Deprecated Class for Removal:

  • org.apache.kafka.streams.errors.BrokerNotFoundException

...

The BrokerNotFoundException class class was deprecated unused since 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.

...

  • Compatibility: This change is not backward compatible at the source code level for users who are still using the BrokerNotFoundException class or implementing/calling these specific deprecated methods.
  • Deprecation: The BrokerNotFoundException was deprecated in usused 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 passed, making their removal appropriate in 5.0.
  • Migration Plan:
    • For BrokerNotFoundException: Users should remove any handling of this exception as it is no longer relevant.
    • For deprecated methods: Users are advised to migrate their code to use the non-deprecated handle methods that accept ErrorHandlerContext. For example:
      • Instead of DeserializationExceptionHandler.handle(ProcessorContext, ConsumerRecord, Exception), use DeserializationExceptionHandler.handle(ErrorHandlerContext, ConsumerRecord, Exception).
      • Instead of ProductionExceptionHandler.handle(ProducerRecord, Exception), use ProductionExceptionHandler.handle(ErrorHandlerContext,ProducerRecord, Exception).
      • Instead of 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 unit tests as needed.

Rejected Alternatives

...