Fix executor termination in StreamBridge

This commit is contained in:
Oleg Zhurakousky
2024-02-22 15:40:28 +01:00
parent e7c1c7f769
commit 3c15eca2c9

View File

@@ -327,14 +327,12 @@ public final class StreamBridge implements StreamOperations, SmartInitializingSi
@Override
public void destroy() throws Exception {
this.executorService.shutdown();
if (!this.executorService.awaitTermination(10000, TimeUnit.MILLISECONDS)) {
logger.warn("Failed to terminate executor. Terminating current tasks.");
this.executorService.shutdownNow();
}
else {
this.executorService.shutdown();
}
this.executorService = null;
this.async = false;
channelCache.keySet().forEach(bindingService::unbindProducers);