diff --git a/smallrye-reactive-messaging-provider/src/main/java/io/smallrye/reactive/messaging/providers/impl/InternalChannelRegistry.java b/smallrye-reactive-messaging-provider/src/main/java/io/smallrye/reactive/messaging/providers/impl/InternalChannelRegistry.java index 642f821f5c..2a3585281e 100644 --- a/smallrye-reactive-messaging-provider/src/main/java/io/smallrye/reactive/messaging/providers/impl/InternalChannelRegistry.java +++ b/smallrye-reactive-messaging-provider/src/main/java/io/smallrye/reactive/messaging/providers/impl/InternalChannelRegistry.java @@ -3,6 +3,7 @@ import static io.smallrye.reactive.messaging.providers.i18n.ProviderMessages.msg; import java.util.*; +import java.util.concurrent.ConcurrentHashMap; import javax.enterprise.context.ApplicationScoped; @@ -23,7 +24,7 @@ public class InternalChannelRegistry implements ChannelRegistry { private final Map outgoing = new HashMap<>(); private final Map incoming = new HashMap<>(); - private final Map> emitters = new HashMap<>(); + private final Map> emitters = new ConcurrentHashMap<>(); private final Map> mutinyEmitters = new HashMap<>(); @Override @@ -67,7 +68,7 @@ public synchronized List>> getPublishers(String n } @Override - public synchronized Emitter getEmitter(String name) { + public Emitter getEmitter(String name) { Objects.requireNonNull(name, msg.nameMustBeSet()); return emitters.get(name); }