Fix Missing Re-Interrupts

This commit is contained in:
Gary Russell
2022-11-03 09:43:53 -04:00
parent 6ec1b3bb02
commit 8c2b325600
2 changed files with 11 additions and 4 deletions

View File

@@ -201,12 +201,15 @@ public class KafkaAdmin extends KafkaResourceFactory
addOrModifyTopicsIfNeeded(adminClient, newTopics);
return true;
}
catch (Exception e) {
catch (InterruptedException ex) {
Thread.currentThread().interrupt();
}
catch (Exception ex) {
if (!this.initializingContext || this.fatalIfBrokerNotAvailable) {
throw new IllegalStateException("Could not configure topics", e);
throw new IllegalStateException("Could not configure topics", ex);
}
else {
LOGGER.error(e, "Could not configure topics");
LOGGER.error(ex, "Could not configure topics");
}
}
finally {

View File

@@ -488,7 +488,11 @@ public abstract class AbstractMessageListenerContainer<K, V>
entry.getValue().get(this.topicCheckTimeout, TimeUnit.SECONDS);
return false;
}
catch (@SuppressWarnings("unused") Exception e) {
catch (InterruptedException ex) {
Thread.currentThread().interrupt();
return true;
}
catch (@SuppressWarnings("unused") Exception ex) {
return true;
}
})