[ https://issues.apache.org/jira/browse/KAFKA-12281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18007669#comment-18007669 ]
Matthias J. Sax commented on KAFKA-12281: ----------------------------------------- The "unused" tag was only added to avoid either compiler or IDE warning I believe. I am pretty sure that `BrokerNotFoundException` is unused, and we should deprecate it for removal (at least this is the regular path; given that `BrokerNotFoundException` is unused for a very long time, we could also make an exception and remove it directly with AK 4.2 release – but it would not follow our regular policy to only remove things in major releases...) I am not aware of any other unused exception classes, but sure, doing an audit is always a good idea. Note: we did recently add few new ones, which are not use {_}yet{_}... They are added as part of KIP that we implement incrementally. We should of course not deprecate these new ones :) But as [~rajani] did already publish a KIP, we can take the discussion there. > cleanup deprecated exceptions in org.apache.kafka.streams.errors.* > ------------------------------------------------------------------ > > Key: KAFKA-12281 > URL: https://issues.apache.org/jira/browse/KAFKA-12281 > Project: Kafka > Issue Type: Improvement > Components: streams > Reporter: Chia-Ping Tsai > Assignee: Rajani Karuturi > Priority: Minor > Labels: beginner, needs-kip, newbie > Attachments: KIP-711.md, image-2025-07-15-11-24-19-092.png, > image-2025-07-16-09-23-11-101.png, image-2025-07-16-09-23-16-144.png, 螢幕快照 > 2025-07-16 12-00-00.png, 螢幕快照 2025-07-16 12-02-01.png > > > It's been 3 years since 234ec8a gets rid of usage of BrokerNotFoundException. > Hence, it is time to deprecate BrokerNotFoundException. > > *Deprecated Class for Removal:* > * {{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 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. -- This message was sent by Atlassian Jira (v8.20.10#820010)