diff --git a/clients/src/main/java/org/apache/kafka/clients/consumer/RetriableCommitFailedException.java b/clients/src/main/java/org/apache/kafka/clients/consumer/RetriableCommitFailedException.java index 33cba6fbc8d..510362ae467 100644 --- a/clients/src/main/java/org/apache/kafka/clients/consumer/RetriableCommitFailedException.java +++ b/clients/src/main/java/org/apache/kafka/clients/consumer/RetriableCommitFailedException.java @@ -27,7 +27,7 @@ public class RetriableCommitFailedException extends RetriableException { } public RetriableCommitFailedException(String message) { - super(message); + super("Offset commit failed with a retriable exception. You should retry committing offsets. The underlying error was: " + message); } public RetriableCommitFailedException(String message, Throwable t) { diff --git a/clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java b/clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java index fa2e31a81b1..7d21767a4e4 100644 --- a/clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java +++ b/clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java @@ -521,7 +521,7 @@ public final class ConsumerCoordinator extends AbstractCoordinator { @Override public void onFailure(RuntimeException e) { pendingAsyncCommits.decrementAndGet(); - completedOffsetCommits.add(new OffsetCommitCompletion(callback, offsets, new RetriableCommitFailedException(e))); + completedOffsetCommits.add(new OffsetCommitCompletion(callback, offsets, new RetriableCommitFailedException(e.getMessage()))); } }); } @@ -550,7 +550,7 @@ public final class ConsumerCoordinator extends AbstractCoordinator { Exception commitException = e; if (e instanceof RetriableException) - commitException = new RetriableCommitFailedException(e); + commitException = new RetriableCommitFailedException(e.getMessage()); completedOffsetCommits.add(new OffsetCommitCompletion(cb, offsets, commitException)); }