Skip to content

Commit 452ec6c

Browse files
committed
GH-1496: Fix RetriableException
Use narrower exception type - noticed during back port.
1 parent 0cb722e commit 452ec6c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spring-kafka/src/main/java/org/springframework/kafka/listener/KafkaMessageListenerContainer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
import org.apache.kafka.common.errors.FencedInstanceIdException;
6262
import org.apache.kafka.common.errors.ProducerFencedException;
6363
import org.apache.kafka.common.errors.RebalanceInProgressException;
64-
import org.apache.kafka.common.errors.RetriableException;
6564
import org.apache.kafka.common.errors.WakeupException;
6665
import org.apache.kafka.common.header.internals.RecordHeader;
6766

@@ -1330,7 +1329,8 @@ else if (this.syncCommits) {
13301329

13311330
private void commitAsync(Map<TopicPartition, OffsetAndMetadata> commits, int retries) {
13321331
this.consumer.commitAsync(commits, (offsetsAttempted, exception) -> {
1333-
if (exception instanceof RetriableException && retries < this.containerProperties.getCommitRetries()) {
1332+
if (exception instanceof RetriableCommitFailedException
1333+
&& retries < this.containerProperties.getCommitRetries()) {
13341334
commitAsync(commits, retries + 1);
13351335
}
13361336
else {

0 commit comments

Comments
 (0)