switch subscriptionchannelfactory to autowire

This commit is contained in:
Ken Stevens 2020-02-24 14:28:14 -05:00
parent 41b5eb2484
commit b33ad73d46
3 changed files with 4 additions and 6 deletions

View File

@ -211,7 +211,7 @@ public abstract class BaseConfig {
@Bean @Bean
public SubscriptionChannelFactory subscriptionChannelFactory() { public SubscriptionChannelFactory subscriptionChannelFactory() {
return new SubscriptionChannelFactory(subscribableChannelFactory()); return new SubscriptionChannelFactory();
} }
@Bean @Bean

View File

@ -22,16 +22,14 @@ package ca.uhn.fhir.jpa.subscription.module.channel;
import ca.uhn.fhir.jpa.subscription.module.ResourceModifiedMessage; import ca.uhn.fhir.jpa.subscription.module.ResourceModifiedMessage;
import ca.uhn.fhir.jpa.subscription.module.subscriber.ResourceDeliveryMessage; import ca.uhn.fhir.jpa.subscription.module.subscriber.ResourceDeliveryMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.SubscribableChannel; import org.springframework.messaging.SubscribableChannel;
public class SubscriptionChannelFactory { public class SubscriptionChannelFactory {
@Autowired
private ISubscribableChannelFactory mySubscribableChannelFactory; private ISubscribableChannelFactory mySubscribableChannelFactory;
public SubscriptionChannelFactory(ISubscribableChannelFactory theSubscribableChannelFactory) {
mySubscribableChannelFactory = theSubscribableChannelFactory;
}
public SubscribableChannel newDeliveryChannel(String theChannelName) { public SubscribableChannel newDeliveryChannel(String theChannelName) {
return mySubscribableChannelFactory.createSubscribableChannel(theChannelName, ResourceDeliveryMessage.class, mySubscribableChannelFactory.getDeliveryChannelConcurrentConsumers()); return mySubscribableChannelFactory.createSubscribableChannel(theChannelName, ResourceDeliveryMessage.class, mySubscribableChannelFactory.getDeliveryChannelConcurrentConsumers());
} }

View File

@ -45,6 +45,6 @@ public abstract class BaseSubscriptionConfig {
@Bean @Bean
public SubscriptionChannelFactory subscriptionChannelFactory() { public SubscriptionChannelFactory subscriptionChannelFactory() {
return new SubscriptionChannelFactory(subscribableChannelFactory()); return new SubscriptionChannelFactory();
} }
} }