Skip to content

Commit

Permalink
Ensure that the executor used for hot deployment of messaging apps is…
Browse files Browse the repository at this point in the history
… shutdown
  • Loading branch information
geoand committed Nov 10, 2022
1 parent 1d82193 commit cdc35d4
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -17,14 +17,19 @@ 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) {
this.context = context;
DevModeSupportConnectorFactoryInterceptor.register(new OnMessage());
}

@Override
public void close() {
executor.shutdown();
}

private class OnMessage implements Supplier<CompletableFuture<Boolean>> {
@Override
public CompletableFuture<Boolean> get() {
Expand Down

0 comments on commit cdc35d4

Please sign in to comment.