Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow overriding message broker ChannelSettings in MDM #6497

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
type: add
issue: 6496
title: "Added support for overriding message broker channel settings for MDM message processing."
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,13 @@ public 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());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ IMdmStorageInterceptor mdmStorageInterceptor() {
}

@Bean
MdmQueueConsumerLoader mdmQueueConsumerLoader(
public MdmQueueConsumerLoader mdmQueueConsumerLoader(
IChannelFactory theChannelFactory, IMdmSettings theMdmSettings, MdmMessageHandler theMdmMessageHandler) {
return new MdmQueueConsumerLoader(theChannelFactory, theMdmSettings, theMdmMessageHandler);
}
Expand Down Expand Up @@ -139,7 +139,7 @@ MessageHelper messageHelper(IMdmSettings theMdmSettings, FhirContext theFhirCont
}

@Bean
MdmSubscriptionLoader mdmSubscriptionLoader() {
public MdmSubscriptionLoader mdmSubscriptionLoader() {
return new MdmSubscriptionLoader();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ synchronized void updateSubscriptionTopic(SubscriptionTopic theSubscriptionTopic
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);
Expand All @@ -147,7 +151,7 @@ private org.hl7.fhir.dstu3.model.Subscription buildMdmSubscriptionDstu3(String t
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;
}
Expand All @@ -168,7 +172,7 @@ private Subscription buildMdmSubscriptionR4(String theId, String theCriteria) {
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;
}
Expand Down Expand Up @@ -216,7 +220,7 @@ private List<IBaseResource> buildMdmSubscriptionR5(SubscriptionTopic theSubscrip
.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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,12 @@ public MdmChannelSubmitterSvcImpl(FhirContext theFhirContext, IChannelFactory th
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);
}
Expand Down
Loading