Skip to content

Commit 30d2b89

Browse files
committed
Fix Missing Re-Interrupts
1 parent 65bbdb6 commit 30d2b89

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

spring-kafka/src/main/java/org/springframework/kafka/core/KafkaAdmin.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,12 +201,15 @@ public final boolean initialize() {
201201
addOrModifyTopicsIfNeeded(adminClient, newTopics);
202202
return true;
203203
}
204-
catch (Exception e) {
204+
catch (InterruptedException ex) {
205+
Thread.currentThread().interrupt();
206+
}
207+
catch (Exception ex) {
205208
if (!this.initializingContext || this.fatalIfBrokerNotAvailable) {
206-
throw new IllegalStateException("Could not configure topics", e);
209+
throw new IllegalStateException("Could not configure topics", ex);
207210
}
208211
else {
209-
LOGGER.error(e, "Could not configure topics");
212+
LOGGER.error(ex, "Could not configure topics");
210213
}
211214
}
212215
finally {

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,11 @@ protected void checkTopics() {
488488
entry.getValue().get(this.topicCheckTimeout, TimeUnit.SECONDS);
489489
return false;
490490
}
491-
catch (@SuppressWarnings("unused") Exception e) {
491+
catch (InterruptedException ex) {
492+
Thread.currentThread().interrupt();
493+
return true;
494+
}
495+
catch (@SuppressWarnings("unused") Exception ex) {
492496
return true;
493497
}
494498
})

0 commit comments

Comments
 (0)