File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
spring-kafka/src/main/java/org/springframework/kafka Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -208,12 +208,15 @@ public final boolean initialize() {
208208 addOrModifyTopicsIfNeeded (adminClient , newTopics );
209209 return true ;
210210 }
211- catch (Exception e ) {
211+ catch (InterruptedException ex ) {
212+ Thread .currentThread ().interrupt ();
213+ }
214+ catch (Exception ex ) {
212215 if (!this .initializingContext || this .fatalIfBrokerNotAvailable ) {
213- throw new IllegalStateException ("Could not configure topics" , e );
216+ throw new IllegalStateException ("Could not configure topics" , ex );
214217 }
215218 else {
216- LOGGER .error (e , "Could not configure topics" );
219+ LOGGER .error (ex , "Could not configure topics" );
217220 }
218221 }
219222 finally {
@@ -267,6 +270,9 @@ public String clusterId() {
267270 try (AdminClient client = createAdmin ()) {
268271 this .clusterId = client .describeCluster ().clusterId ().get (this .operationTimeout , TimeUnit .SECONDS );
269272 }
273+ catch (InterruptedException ex ) {
274+ Thread .currentThread ().interrupt ();
275+ }
270276 catch (Exception ex ) {
271277 LOGGER .error (ex , "Could not obtaine cluster info" );
272278 }
Original file line number Diff line number Diff line change @@ -510,7 +510,11 @@ protected void checkTopics() {
510510 entry .getValue ().get (this .topicCheckTimeout , TimeUnit .SECONDS );
511511 return false ;
512512 }
513- catch (@ SuppressWarnings ("unused" ) Exception e ) {
513+ catch (InterruptedException ex ) {
514+ Thread .currentThread ().interrupt ();
515+ return true ;
516+ }
517+ catch (@ SuppressWarnings ("unused" ) Exception ex ) {
514518 return true ;
515519 }
516520 })
You can’t perform that action at this time.
0 commit comments