WIP
This commit is contained in:
6
pom.xml
6
pom.xml
@@ -83,6 +83,12 @@
|
|||||||
<artifactId>hapi-fhir-base</artifactId>
|
<artifactId>hapi-fhir-base</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- This dependency includes the EmailSenderImpl we will be using instead of standard javamail.-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
|
<artifactId>hapi-fhir-jpaserver-subscription</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- This dependency includes the JPA server itself, which is packaged separately from the rest of HAPI FHIR -->
|
<!-- This dependency includes the JPA server itself, which is packaged separately from the rest of HAPI FHIR -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -74,6 +74,9 @@ public class AppProperties {
|
|||||||
private Boolean use_apache_address_strategy = false;
|
private Boolean use_apache_address_strategy = false;
|
||||||
private Boolean use_apache_address_strategy_https = false;
|
private Boolean use_apache_address_strategy_https = false;
|
||||||
|
|
||||||
|
private Integer bundle_batch_pool_size = 20;
|
||||||
|
private Integer bundle_batch_pool_max_size = 100;
|
||||||
|
|
||||||
public Boolean getUse_apache_address_strategy() {
|
public Boolean getUse_apache_address_strategy() {
|
||||||
return use_apache_address_strategy;
|
return use_apache_address_strategy;
|
||||||
}
|
}
|
||||||
@@ -471,6 +474,22 @@ public class AppProperties {
|
|||||||
this.install_transitive_ig_dependencies = install_transitive_ig_dependencies;
|
this.install_transitive_ig_dependencies = install_transitive_ig_dependencies;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getBundle_batch_pool_size() {
|
||||||
|
return this.bundle_batch_pool_size;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBundle_batch_pool_size(Integer bundle_batch_pool_size) {
|
||||||
|
this.bundle_batch_pool_size = bundle_batch_pool_size;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getBundle_batch_pool_max_size() {
|
||||||
|
return bundle_batch_pool_max_size;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBundle_batch_pool_max_size(Integer bundle_batch_pool_max_size) {
|
||||||
|
this.bundle_batch_pool_max_size = bundle_batch_pool_max_size;
|
||||||
|
}
|
||||||
|
|
||||||
public static class Cors {
|
public static class Cors {
|
||||||
private Boolean allow_Credentials = true;
|
private Boolean allow_Credentials = true;
|
||||||
private List<String> allowed_origin = ImmutableList.of("*");
|
private List<String> allowed_origin = ImmutableList.of("*");
|
||||||
|
|||||||
@@ -373,6 +373,11 @@ public class BaseJpaRestfulServer extends RestfulServer {
|
|||||||
daoConfig.setResourceServerIdStrategy(DaoConfig.IdStrategyEnum.UUID);
|
daoConfig.setResourceServerIdStrategy(DaoConfig.IdStrategyEnum.UUID);
|
||||||
daoConfig.setResourceClientIdStrategy(appProperties.getClient_id_strategy());
|
daoConfig.setResourceClientIdStrategy(appProperties.getClient_id_strategy());
|
||||||
}
|
}
|
||||||
|
//Parallel Batch GET execution settings
|
||||||
|
daoConfig.setBundleBatchPoolSize(appProperties.getBundle_batch_pool_size());
|
||||||
|
daoConfig.setBundleBatchPoolSize(appProperties.getBundle_batch_pool_max_size());
|
||||||
|
System.out.println("BATCH SIZE IS " + appProperties.getBundle_batch_pool_size());
|
||||||
|
System.out.println("BATCH MAX SIZE IS " + appProperties.getBundle_batch_pool_max_size());
|
||||||
|
|
||||||
if (appProperties.getImplementationGuides() != null) {
|
if (appProperties.getImplementationGuides() != null) {
|
||||||
Map<String, AppProperties.ImplementationGuide> guides = appProperties.getImplementationGuides();
|
Map<String, AppProperties.ImplementationGuide> guides = appProperties.getImplementationGuides();
|
||||||
|
|||||||
@@ -8,10 +8,16 @@ import ca.uhn.fhir.jpa.model.config.PartitionSettings;
|
|||||||
import ca.uhn.fhir.jpa.model.config.PartitionSettings.CrossPartitionReferenceMode;
|
import ca.uhn.fhir.jpa.model.config.PartitionSettings.CrossPartitionReferenceMode;
|
||||||
import ca.uhn.fhir.jpa.model.entity.ModelConfig;
|
import ca.uhn.fhir.jpa.model.entity.ModelConfig;
|
||||||
import ca.uhn.fhir.jpa.subscription.channel.subscription.SubscriptionDeliveryHandlerFactory;
|
import ca.uhn.fhir.jpa.subscription.channel.subscription.SubscriptionDeliveryHandlerFactory;
|
||||||
|
import ca.uhn.fhir.jpa.subscription.match.deliver.email.EmailSenderImpl;
|
||||||
import ca.uhn.fhir.jpa.subscription.match.deliver.email.IEmailSender;
|
import ca.uhn.fhir.jpa.subscription.match.deliver.email.IEmailSender;
|
||||||
import ca.uhn.fhir.jpa.subscription.match.deliver.email.JavaMailEmailSender;
|
import ca.uhn.fhir.rest.server.mail.MailConfig;
|
||||||
import com.google.common.base.Strings;
|
import com.google.common.base.Strings;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.hl7.fhir.dstu2.model.Subscription;
|
import org.hl7.fhir.dstu2.model.Subscription;
|
||||||
|
import org.simplejavamail.api.email.Email;
|
||||||
|
import org.simplejavamail.api.mailer.Mailer;
|
||||||
|
import org.simplejavamail.api.mailer.config.TransportStrategy;
|
||||||
|
import org.simplejavamail.mailer.MailerBuilder;
|
||||||
import org.springframework.boot.env.YamlPropertySourceLoader;
|
import org.springframework.boot.env.YamlPropertySourceLoader;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
@@ -205,23 +211,20 @@ public class FhirServerConfigCommon {
|
|||||||
@Bean()
|
@Bean()
|
||||||
public IEmailSender emailSender(AppProperties appProperties, Optional<SubscriptionDeliveryHandlerFactory> subscriptionDeliveryHandlerFactory) {
|
public IEmailSender emailSender(AppProperties appProperties, Optional<SubscriptionDeliveryHandlerFactory> subscriptionDeliveryHandlerFactory) {
|
||||||
if (appProperties.getSubscription() != null && appProperties.getSubscription().getEmail() != null) {
|
if (appProperties.getSubscription() != null && appProperties.getSubscription().getEmail() != null) {
|
||||||
JavaMailEmailSender retVal = new JavaMailEmailSender();
|
AppProperties.Subscription.Email email = appProperties.getSubscription().getEmail();
|
||||||
|
MailConfig mailConfig = new MailConfig();
|
||||||
|
mailConfig.setSmtpHostname(email.getHost());
|
||||||
|
mailConfig.setSmtpUseStartTLS(email.getStartTlsRequired());
|
||||||
|
mailConfig.setSmtpPort(email.getPort());
|
||||||
|
mailConfig.setSmtpUsername(email.getUsername());
|
||||||
|
mailConfig.setSmtpPassword(email.getPassword());
|
||||||
|
EmailSenderImpl emailSender = new EmailSenderImpl(mailConfig);
|
||||||
|
|
||||||
AppProperties.Subscription.Email email = appProperties.getSubscription().getEmail();
|
if(subscriptionDeliveryHandlerFactory.isPresent()) {
|
||||||
retVal.setSmtpServerHostname(email.getHost());
|
subscriptionDeliveryHandlerFactory.get().setEmailSender(emailSender);
|
||||||
retVal.setSmtpServerPort(email.getPort());
|
}
|
||||||
retVal.setSmtpServerUsername(email.getUsername());
|
|
||||||
retVal.setSmtpServerPassword(email.getPassword());
|
|
||||||
retVal.setAuth(email.getAuth());
|
|
||||||
retVal.setStartTlsEnable(email.getStartTlsEnable());
|
|
||||||
retVal.setStartTlsRequired(email.getStartTlsRequired());
|
|
||||||
retVal.setQuitWait(email.getQuitWait());
|
|
||||||
|
|
||||||
if(subscriptionDeliveryHandlerFactory.isPresent())
|
}
|
||||||
subscriptionDeliveryHandlerFactory.get().setEmailSender(retVal);
|
|
||||||
|
|
||||||
return retVal;
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,6 +99,10 @@ hapi:
|
|||||||
search-coord-max-pool-size: 100
|
search-coord-max-pool-size: 100
|
||||||
search-coord-queue-capacity: 200
|
search-coord-queue-capacity: 200
|
||||||
|
|
||||||
|
# Threadpool size for BATCH'ed GETs in a bundle.
|
||||||
|
# bundle_batch_pool_size: 10
|
||||||
|
# bundle_batch_pool_max_size: 50
|
||||||
|
|
||||||
# logger:
|
# logger:
|
||||||
# error_format: 'ERROR - ${requestVerb} ${requestUrl}'
|
# error_format: 'ERROR - ${requestVerb} ${requestUrl}'
|
||||||
# format: >-
|
# format: >-
|
||||||
|
|||||||
Reference in New Issue
Block a user