diff --git a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/channel/SubscriptionChannelRegistry.java b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/channel/SubscriptionChannelRegistry.java index c020f266e54..5ca8f099bc9 100644 --- a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/channel/SubscriptionChannelRegistry.java +++ b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/module/channel/SubscriptionChannelRegistry.java @@ -32,7 +32,7 @@ public class SubscriptionChannelRegistry { @Autowired private ModelConfig myModelConfig; - public void add(ActiveSubscription theActiveSubscription) { + public synchronized void add(ActiveSubscription theActiveSubscription) { if (!myModelConfig.isSubscriptionMatchingEnabled()) { return; } @@ -56,7 +56,7 @@ public class SubscriptionChannelRegistry { mySubscriptionChannelCache.put(channelName, subscriptionChannelWithHandlers); } - public void remove(ActiveSubscription theActiveSubscription) { + public synchronized void remove(ActiveSubscription theActiveSubscription) { if (!myModelConfig.isSubscriptionMatchingEnabled()) { return; } @@ -77,7 +77,7 @@ public class SubscriptionChannelRegistry { } } - public SubscriptionChannelWithHandlers get(String theChannelName) { + public synchronized SubscriptionChannelWithHandlers get(String theChannelName) { return mySubscriptionChannelCache.get(theChannelName); }