Externalizes more subscription parameters (#783)
* Externalizes more subscription parameters Allows : - to parametrize the polling interval of subscription - to enable the setting to queue the subscription jobs immediately. Following the change in hapifhir/hapi-fhir/pull/6395 * Fix formatting
This commit is contained in:
@@ -683,31 +683,41 @@ public class AppProperties {
|
|||||||
this.resource_dbhistory_enabled = resource_dbhistory_enabled;
|
this.resource_dbhistory_enabled = resource_dbhistory_enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Boolean getPre_expand_value_sets() { return this.pre_expand_value_sets; }
|
public Boolean getPre_expand_value_sets() {
|
||||||
|
return this.pre_expand_value_sets;
|
||||||
|
}
|
||||||
|
|
||||||
public void setPre_expand_value_sets(Boolean pre_expand_value_sets) {
|
public void setPre_expand_value_sets(Boolean pre_expand_value_sets) {
|
||||||
this.pre_expand_value_sets = pre_expand_value_sets;
|
this.pre_expand_value_sets = pre_expand_value_sets;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Boolean getEnable_task_pre_expand_value_sets() { return this.enable_task_pre_expand_value_sets; }
|
public Boolean getEnable_task_pre_expand_value_sets() {
|
||||||
|
return this.enable_task_pre_expand_value_sets;
|
||||||
|
}
|
||||||
|
|
||||||
public void setEnable_task_pre_expand_value_setss(Boolean enable_task_pre_expand_value_sets) {
|
public void setEnable_task_pre_expand_value_setss(Boolean enable_task_pre_expand_value_sets) {
|
||||||
this.enable_task_pre_expand_value_sets = enable_task_pre_expand_value_sets;
|
this.enable_task_pre_expand_value_sets = enable_task_pre_expand_value_sets;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getPre_expand_value_sets_default_count() {return pre_expand_value_sets_default_count; }
|
public Integer getPre_expand_value_sets_default_count() {
|
||||||
|
return pre_expand_value_sets_default_count;
|
||||||
|
}
|
||||||
|
|
||||||
public void setPre_expand_value_sets_default_count(Integer pre_expand_value_sets_default_count) {
|
public void setPre_expand_value_sets_default_count(Integer pre_expand_value_sets_default_count) {
|
||||||
this.pre_expand_value_sets_default_count = pre_expand_value_sets_default_count;
|
this.pre_expand_value_sets_default_count = pre_expand_value_sets_default_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getPre_expand_value_sets_max_count() { return pre_expand_value_sets_max_count; }
|
public Integer getPre_expand_value_sets_max_count() {
|
||||||
|
return pre_expand_value_sets_max_count;
|
||||||
|
}
|
||||||
|
|
||||||
public void setPre_expand_value_sets_max_count(Integer pre_expand_value_sets_max_count) {
|
public void setPre_expand_value_sets_max_count(Integer pre_expand_value_sets_max_count) {
|
||||||
this.pre_expand_value_sets_max_count = pre_expand_value_sets_max_count;
|
this.pre_expand_value_sets_max_count = pre_expand_value_sets_max_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getMaximum_expansion_size() { return maximum_expansion_size; }
|
public Integer getMaximum_expansion_size() {
|
||||||
|
return maximum_expansion_size;
|
||||||
|
}
|
||||||
|
|
||||||
public void setMaximum_expansion_size(Integer maximum_expansion_size) {
|
public void setMaximum_expansion_size(Integer maximum_expansion_size) {
|
||||||
this.maximum_expansion_size = maximum_expansion_size;
|
this.maximum_expansion_size = maximum_expansion_size;
|
||||||
@@ -914,6 +924,8 @@ public class AppProperties {
|
|||||||
private Boolean resthook_enabled = false;
|
private Boolean resthook_enabled = false;
|
||||||
private Boolean websocket_enabled = false;
|
private Boolean websocket_enabled = false;
|
||||||
private Email email = null;
|
private Email email = null;
|
||||||
|
private Integer polling_interval_ms = null;
|
||||||
|
private Boolean immediately_queued = false;
|
||||||
|
|
||||||
public Boolean getResthook_enabled() {
|
public Boolean getResthook_enabled() {
|
||||||
return resthook_enabled;
|
return resthook_enabled;
|
||||||
@@ -939,6 +951,22 @@ public class AppProperties {
|
|||||||
this.email = email;
|
this.email = email;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getPolling_interval_ms() {
|
||||||
|
return polling_interval_ms;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPolling_interval_ms(Integer polling_interval_ms) {
|
||||||
|
this.polling_interval_ms = polling_interval_ms;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getImmediately_queued() {
|
||||||
|
return immediately_queued;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImmediately_queued(Boolean immediately_queued) {
|
||||||
|
this.immediately_queued = immediately_queued;
|
||||||
|
}
|
||||||
|
|
||||||
public static class Email {
|
public static class Email {
|
||||||
private String from;
|
private String from;
|
||||||
private String host;
|
private String host;
|
||||||
|
|||||||
@@ -91,11 +91,15 @@ public class FhirServerConfigCommon {
|
|||||||
|
|
||||||
ourLog.info("Server configured to " + (appProperties.getPre_expand_value_sets() ? "enable" : "disable")
|
ourLog.info("Server configured to " + (appProperties.getPre_expand_value_sets() ? "enable" : "disable")
|
||||||
+ " value set pre-expansion");
|
+ " value set pre-expansion");
|
||||||
ourLog.info("Server configured to " + (appProperties.getEnable_task_pre_expand_value_sets() ? "enable" : "disable")
|
ourLog.info(
|
||||||
|
"Server configured to " + (appProperties.getEnable_task_pre_expand_value_sets() ? "enable" : "disable")
|
||||||
+ " value set pre-expansion task");
|
+ " value set pre-expansion task");
|
||||||
ourLog.info("Server configured for pre-expand value set default count of " + (appProperties.getPre_expand_value_sets_default_count().toString()));
|
ourLog.info("Server configured for pre-expand value set default count of "
|
||||||
ourLog.info("Server configured for pre-expand value set max count of " + (appProperties.getPre_expand_value_sets_default_count().toString()));
|
+ (appProperties.getPre_expand_value_sets_default_count().toString()));
|
||||||
ourLog.info("Server configured for maximum expansion size of " + (appProperties.getPre_expand_value_sets_default_count().toString()));
|
ourLog.info("Server configured for pre-expand value set max count of "
|
||||||
|
+ (appProperties.getPre_expand_value_sets_default_count().toString()));
|
||||||
|
ourLog.info("Server configured for maximum expansion size of "
|
||||||
|
+ (appProperties.getPre_expand_value_sets_default_count().toString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
@@ -122,6 +126,18 @@ public class FhirServerConfigCommon {
|
|||||||
subscriptionSettings.addSupportedSubscriptionType(
|
subscriptionSettings.addSupportedSubscriptionType(
|
||||||
org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.WEBSOCKET);
|
org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.WEBSOCKET);
|
||||||
}
|
}
|
||||||
|
if (appProperties.getSubscription().getPolling_interval_ms() != null) {
|
||||||
|
ourLog.info(
|
||||||
|
"Setting subscription polling interval to {} ms",
|
||||||
|
appProperties.getSubscription().getPolling_interval_ms());
|
||||||
|
subscriptionSettings.setSubscriptionIntervalInMs(
|
||||||
|
appProperties.getSubscription().getPolling_interval_ms());
|
||||||
|
}
|
||||||
|
if (appProperties.getSubscription().getImmediately_queued()) {
|
||||||
|
ourLog.info("Subscription update will be queued immediately");
|
||||||
|
subscriptionSettings.setSubscriptionChangeQueuedImmediately(
|
||||||
|
appProperties.getSubscription().getImmediately_queued());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (appProperties.getMdm_enabled()) {
|
if (appProperties.getMdm_enabled()) {
|
||||||
// MDM requires the subscription of type message
|
// MDM requires the subscription of type message
|
||||||
|
|||||||
@@ -309,6 +309,8 @@ hapi:
|
|||||||
# subscription:
|
# subscription:
|
||||||
# resthook_enabled: true
|
# resthook_enabled: true
|
||||||
# websocket_enabled: false
|
# websocket_enabled: false
|
||||||
|
# polling_interval_ms: 5000
|
||||||
|
# immediately_queued: false
|
||||||
# email:
|
# email:
|
||||||
# from: some@test.com
|
# from: some@test.com
|
||||||
# host: google.com
|
# host: google.com
|
||||||
|
|||||||
Reference in New Issue
Block a user