From 2602dc978ffdc4d9acbe0707de1596907955101a Mon Sep 17 00:00:00 2001 From: volodymyr Date: Thu, 21 Nov 2024 23:04:27 -0700 Subject: [PATCH] Add support for disabling prefixChannelName to message broker ChannelSettings --- ...add-disable-channel-name-prefix-configuration.yaml | 5 +++++ .../subscription/channel/api/BaseChannelSettings.java | 11 +++++++++++ .../subscription/channel/api/IChannelSettings.java | 2 ++ 3 files changed, 18 insertions(+) create mode 100644 hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_8_0/6496-add-disable-channel-name-prefix-configuration.yaml diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_8_0/6496-add-disable-channel-name-prefix-configuration.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_8_0/6496-add-disable-channel-name-prefix-configuration.yaml new file mode 100644 index 00000000000..0295e809ff7 --- /dev/null +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_8_0/6496-add-disable-channel-name-prefix-configuration.yaml @@ -0,0 +1,5 @@ +--- +type: add +issue: 6496 +title: "Added a configuration option to ChannelSettings that allows message brokers to disable channel name prefix +for chosen topics." diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/BaseChannelSettings.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/BaseChannelSettings.java index de72550f73c..7e12d5c40e8 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/BaseChannelSettings.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/BaseChannelSettings.java @@ -29,6 +29,8 @@ public abstract class BaseChannelSettings implements IChannelSettings { // init true to match previous behaviour private boolean myUseJacksonMessageConverter = true; + private boolean myUsePrefixChannelName = true; + /** * Default true. Used by IChannelNamer to decide how to qualify the channel name. */ @@ -60,4 +62,13 @@ public abstract class BaseChannelSettings implements IChannelSettings { public void setUseJacksonMessageConverter(boolean theUseJacksonMessageConverter) { myUseJacksonMessageConverter = theUseJacksonMessageConverter; } + + @Override + public boolean isUsePrefixChannelName() { + return myUsePrefixChannelName; + } + + public void setUsePrefixChannelName(boolean theUsePrefixChannelName) { + myUsePrefixChannelName = theUsePrefixChannelName; + } } diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/IChannelSettings.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/IChannelSettings.java index f14f9f7a585..78d7671fc57 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/IChannelSettings.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/subscription/channel/api/IChannelSettings.java @@ -23,4 +23,6 @@ public interface IChannelSettings { boolean isQualifyChannelName(); boolean isUseJacksonMessageConverter(); + + boolean isUsePrefixChannelName(); }