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
public SubscriptionChannelFactory subscriptionChannelFactory() {
return new SubscriptionChannelFactory(subscribableChannelFactory());
return new SubscriptionChannelFactory();
}
@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.subscriber.ResourceDeliveryMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.SubscribableChannel;
public class SubscriptionChannelFactory {
@Autowired
private ISubscribableChannelFactory mySubscribableChannelFactory;
public SubscriptionChannelFactory(ISubscribableChannelFactory theSubscribableChannelFactory) {
mySubscribableChannelFactory = theSubscribableChannelFactory;
}
public SubscribableChannel newDeliveryChannel(String theChannelName) {
return mySubscribableChannelFactory.createSubscribableChannel(theChannelName, ResourceDeliveryMessage.class, mySubscribableChannelFactory.getDeliveryChannelConcurrentConsumers());
}

View File

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