From cdc35d4a7b7c6e284aa973b756deb02654380f1e Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Thu, 10 Nov 2022 09:30:33 +0200 Subject: [PATCH] Ensure that the executor used for hot deployment of messaging apps is shutdown --- .../devmode/ReactiveMessagingHotReplacementSetup.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/extensions/smallrye-reactive-messaging/runtime/src/main/java/io/quarkus/smallrye/reactivemessaging/runtime/devmode/ReactiveMessagingHotReplacementSetup.java b/extensions/smallrye-reactive-messaging/runtime/src/main/java/io/quarkus/smallrye/reactivemessaging/runtime/devmode/ReactiveMessagingHotReplacementSetup.java index da735642fa556..de341cfefb784 100644 --- a/extensions/smallrye-reactive-messaging/runtime/src/main/java/io/quarkus/smallrye/reactivemessaging/runtime/devmode/ReactiveMessagingHotReplacementSetup.java +++ b/extensions/smallrye-reactive-messaging/runtime/src/main/java/io/quarkus/smallrye/reactivemessaging/runtime/devmode/ReactiveMessagingHotReplacementSetup.java @@ -1,7 +1,7 @@ package io.quarkus.smallrye.reactivemessaging.runtime.devmode; import java.util.concurrent.CompletableFuture; -import java.util.concurrent.Executor; +import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.function.Supplier; @@ -17,7 +17,7 @@ public class ReactiveMessagingHotReplacementSetup implements HotReplacementSetup private HotReplacementContext context; private volatile long nextUpdate; - private final Executor executor = Executors.newSingleThreadExecutor(); + private final ExecutorService executor = Executors.newSingleThreadExecutor(); @Override public void setupHotDeployment(HotReplacementContext context) { @@ -25,6 +25,11 @@ public void setupHotDeployment(HotReplacementContext context) { DevModeSupportConnectorFactoryInterceptor.register(new OnMessage()); } + @Override + public void close() { + executor.shutdown(); + } + private class OnMessage implements Supplier> { @Override public CompletableFuture get() {