Allow overriding message broker ChannelSettings in MDM (#6497)

* Add support for disabling prefixChannelName to message broker ChannelSettings

* Add support for disabling ChannelNamePrefix to message broker ChannelSettings - method names update

* Added support for overriding message broker channel settings for MDM message processing

* Added support for overriding message broker channel settings for MDM message processing
This commit is contained in:
volodymyr-korzh 2024-12-12 13:42:56 -07:00 committed by GitHub
parent 2d740f8d85
commit fe3baa2bb0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 23 additions and 7 deletions

View File

@ -0,0 +1,4 @@
---
type: add
issue: 6496
title: "Added support for overriding message broker channel settings for MDM message processing."

View File

@ -55,9 +55,13 @@ public class MdmQueueConsumerLoader {
startListeningToMdmChannel();
}
protected ChannelConsumerSettings getChannelConsumerSettings() {
return new ChannelConsumerSettings();
}
private void startListeningToMdmChannel() {
if (myMdmChannel == null) {
ChannelConsumerSettings config = new ChannelConsumerSettings();
ChannelConsumerSettings config = getChannelConsumerSettings();
config.setConcurrentConsumers(myMdmSettings.getConcurrentConsumers());

View File

@ -92,7 +92,7 @@ public class MdmConsumerConfig {
}
@Bean
MdmQueueConsumerLoader mdmQueueConsumerLoader(
public MdmQueueConsumerLoader mdmQueueConsumerLoader(
IChannelFactory theChannelFactory, IMdmSettings theMdmSettings, MdmMessageHandler theMdmMessageHandler) {
return new MdmQueueConsumerLoader(theChannelFactory, theMdmSettings, theMdmMessageHandler);
}
@ -139,7 +139,7 @@ public class MdmConsumerConfig {
}
@Bean
MdmSubscriptionLoader mdmSubscriptionLoader() {
public MdmSubscriptionLoader mdmSubscriptionLoader() {
return new MdmSubscriptionLoader();
}

View File

@ -131,6 +131,10 @@ public class MdmSubscriptionLoader {
mySubscriptionTopicDao.update(theSubscriptionTopic, SystemRequestDetails.forAllPartitions());
}
protected ChannelProducerSettings getChannelProducerSettings() {
return new ChannelProducerSettings();
}
private org.hl7.fhir.dstu3.model.Subscription buildMdmSubscriptionDstu3(String theId, String theCriteria) {
org.hl7.fhir.dstu3.model.Subscription retval = new org.hl7.fhir.dstu3.model.Subscription();
retval.setId(theId);
@ -147,7 +151,7 @@ public class MdmSubscriptionLoader {
org.hl7.fhir.dstu3.model.Subscription.SubscriptionChannelComponent channel = retval.getChannel();
channel.setType(org.hl7.fhir.dstu3.model.Subscription.SubscriptionChannelType.MESSAGE);
channel.setEndpoint("channel:"
+ myChannelNamer.getChannelName(IMdmSettings.EMPI_CHANNEL_NAME, new ChannelProducerSettings()));
+ myChannelNamer.getChannelName(IMdmSettings.EMPI_CHANNEL_NAME, getChannelProducerSettings()));
channel.setPayload(Constants.CT_JSON);
return retval;
}
@ -168,7 +172,7 @@ public class MdmSubscriptionLoader {
Subscription.SubscriptionChannelComponent channel = retval.getChannel();
channel.setType(Subscription.SubscriptionChannelType.MESSAGE);
channel.setEndpoint("channel:"
+ myChannelNamer.getChannelName(IMdmSettings.EMPI_CHANNEL_NAME, new ChannelProducerSettings()));
+ myChannelNamer.getChannelName(IMdmSettings.EMPI_CHANNEL_NAME, getChannelProducerSettings()));
channel.setPayload(Constants.CT_JSON);
return retval;
}
@ -216,7 +220,7 @@ public class MdmSubscriptionLoader {
.setSystem(CanonicalSubscriptionChannelType.MESSAGE.getSystem()));
subscription.setEndpoint("channel:"
+ myChannelNamer.getChannelName(IMdmSettings.EMPI_CHANNEL_NAME, new ChannelProducerSettings()));
+ myChannelNamer.getChannelName(IMdmSettings.EMPI_CHANNEL_NAME, getChannelProducerSettings()));
subscription.setContentType(Constants.CT_JSON);
return Collections.singletonList(subscription);

View File

@ -82,8 +82,12 @@ public class MdmChannelSubmitterSvcImpl implements IMdmChannelSubmitterSvc {
myChannelFactory = theIChannelFactory;
}
protected ChannelProducerSettings getChannelProducerSettings() {
return new ChannelProducerSettings();
}
private void init() {
ChannelProducerSettings channelSettings = new ChannelProducerSettings();
ChannelProducerSettings channelSettings = getChannelProducerSettings();
myMdmChannelProducer = myChannelFactory.getOrCreateProducer(
EMPI_CHANNEL_NAME, ResourceModifiedJsonMessage.class, channelSettings);
}