KAFKA-18348 Remove the deprecated MockConsumer#setException (#18317)

Reviewers: TengYao Chi <kitingiao@gmail.com>, TaiJuWu <tjwu1217@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
This commit is contained in:
xijiu 2024-12-27 12:31:23 +08:00 committed by GitHub
parent 2e3b4cb957
commit 6139840e98
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 8 deletions

View File

@ -314,14 +314,6 @@ public class MockConsumer<K, V> implements Consumer<K, V> {
recs.add(record);
}
/**
* @deprecated Use {@link #setPollException(KafkaException)} instead
*/
@Deprecated
public synchronized void setException(KafkaException exception) {
setPollException(exception);
}
public synchronized void setPollException(KafkaException exception) {
this.pollException = exception;
}

View File

@ -188,6 +188,10 @@
<li>The <code>committed(TopicPartition)</code> and <code>committed(TopicPartition, Duration)</code> methods were removed from the consumer.
Please use <code>committed(Set&ltTopicPartition&gt)</code> and <code>committed(Set&ltTopicPartition&gt, Duration)</code> instead.
</li>
<li>
The <code>setException(KafkaException)</code> method was removed from the <code>org.apache.kafka.clients.consumer.MockConsumer</code>.
Please use <code>setPollException(KafkaException)</code> instead.
</li>
</ul>
</li>
<li><b>Producer</b>