FINERACT-1492: Hikari configuration based on application properties
This commit is contained in:
committed by
Aleksandar Vidakovic
parent
1f6ff8ccad
commit
c66415dbfd
@@ -54,7 +54,7 @@ Instructions to build the JAR file
|
|||||||
|
|
||||||
The tenants database connection details are configured [via environment variables (as with Docker container)](#instructions-to-run-using-docker-and-docker-compose), e.g. like this:
|
The tenants database connection details are configured [via environment variables (as with Docker container)](#instructions-to-run-using-docker-and-docker-compose), e.g. like this:
|
||||||
|
|
||||||
export fineract_tenants_pwd=verysecret
|
export FINERACT_HIKARI_PASSWORD=verysecret
|
||||||
...
|
...
|
||||||
java -jar fineract-provider.jar
|
java -jar fineract-provider.jar
|
||||||
|
|
||||||
@@ -179,6 +179,13 @@ _(Note that in previous versions, the `mysqlserver` environment variable used at
|
|||||||
and the `mysqlserver` environment variable is now no longer supported.)_
|
and the `mysqlserver` environment variable is now no longer supported.)_
|
||||||
|
|
||||||
|
|
||||||
|
Connection pool configuration
|
||||||
|
=============================
|
||||||
|
|
||||||
|
Please check `application.properties` to see which connection pool settings can be tweaked. The associated environment variables are prefixed with `FINERACT_HIKARI_*`. You can find more information about specific connection pool settings (Hikari) at https://github.com/brettwooldridge/HikariCP#configuration-knobs-baby
|
||||||
|
|
||||||
|
NOTE: we'll keep backwards compatibility until one of the next releases to ensure that things are working as expected. Environment variables prefixed `fineract_tenants_*` can still be used to configure the database connection, but we strongly encourage using `FINERACT_HIKARI_*` with more options.
|
||||||
|
|
||||||
Instructions to run on Kubernetes
|
Instructions to run on Kubernetes
|
||||||
=================================
|
=================================
|
||||||
|
|
||||||
|
|||||||
+36
-8
@@ -49,19 +49,47 @@ services:
|
|||||||
fineractmysql:
|
fineractmysql:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
environment:
|
environment:
|
||||||
- DRIVERCLASS_NAME=org.mariadb.jdbc.Driver
|
# TODO: env vars prefixed with "fineract_tenants_*" will be removed with one of the next releases
|
||||||
- PROTOCOL=jdbc
|
#- fineract_tenants_driver=org.mariadb.jdbc.Driver
|
||||||
- node_id=1
|
#- fineract_tenants_url=jdbc:mariadb://fineractmysql:3306/fineract_tenants
|
||||||
- SUB_PROTOCOL=mariadb
|
#- fineract_tenants_uid=root
|
||||||
- fineract_tenants_driver=org.mariadb.jdbc.Driver
|
#- fineract_tenants_pwd=skdcnwauicn2ucnaecasdsajdnizucawencascdca
|
||||||
- fineract_tenants_url=jdbc:mariadb://fineractmysql:3306/fineract_tenants
|
# NOTE: node aware scheduler
|
||||||
- fineract_tenants_uid=root
|
- FINERACT_NODE_ID=1
|
||||||
- fineract_tenants_pwd=skdcnwauicn2ucnaecasdsajdnizucawencascdca
|
# NOTE: env vars prefixed "FINERACT_HIKARI_*" are used to configure the database connection pool
|
||||||
|
- FINERACT_HIKARI_DRIVER_CLASS_NAME=org.mariadb.jdbc.Driver
|
||||||
|
- FINERACT_HIKARI_JDBC_URL=jdbc:mariadb://fineractmysql:3306/fineract_tenants
|
||||||
|
- FINERACT_HIKARI_USERNAME=root
|
||||||
|
- FINERACT_HIKARI_PASSWORD=skdcnwauicn2ucnaecasdsajdnizucawencascdca
|
||||||
|
# ... following variables are optional; "application.properties" contains reasonable defaults (same as here)
|
||||||
|
- FINERACT_HIKARI_MINIMUM_IDLE=3
|
||||||
|
- FINERACT_HIKARI_MAXIMUM_POOL_SIZE=10
|
||||||
|
- FINERACT_HIKARI_IDLE_TIMEOUT=60000
|
||||||
|
- FINERACT_HIKARI_CONNECTION_TIMEOUT=20000
|
||||||
|
- FINERACT_HIKARI_TEST_QUERY=SELECT 1
|
||||||
|
- FINERACT_HIKARI_AUTO_COMMIT=true
|
||||||
|
- FINERACT_HIKARI_DS_PROPERTIES_CACHE_PREP_STMTS=true
|
||||||
|
- FINERACT_HIKARI_DS_PROPERTIES_PREP_STMT_CACHE_SIZE=250
|
||||||
|
- FINERACT_HIKARI_DS_PROPERTIES_PREP_STMT_CACHE_SQL_LIMIT=2048
|
||||||
|
- FINERACT_HIKARI_DS_PROPERTIES_USE_SERVER_PREP_STMTS=true
|
||||||
|
- FINERACT_HIKARI_DS_PROPERTIES_USE_LOCAL_SESSION_STATE=true
|
||||||
|
- FINERACT_HIKARI_DS_PROPERTIES_REWRITE_BATCHED_STATEMENTS=true
|
||||||
|
- FINERACT_HIKARI_DS_PROPERTIES_CACHE_RESULT_SET_METADATA=true
|
||||||
|
- FINERACT_HIKARI_DS_PROPERTIES_CACHE_SERVER_CONFIGURATION=true
|
||||||
|
- FINERACT_HIKARI_DS_PROPERTIES_ELIDE_SET_AUTO_COMMITS=true
|
||||||
|
- FINERACT_HIKARI_DS_PROPERTIES_MAINTAIN_TIME_STATS=false
|
||||||
|
- FINERACT_HIKARI_DS_PROPERTIES_LOG_SLOW_QUERIES=true
|
||||||
|
- FINERACT_HIKARI_DS_PROPERTIES_DUMP_QUERIES_IN_EXCEPTION=true
|
||||||
|
# NOTE: env vars prefixed "FINERACT_DEFAULT_TENANTDB_*" are used to create the default tenant database
|
||||||
- FINERACT_DEFAULT_TENANTDB_HOSTNAME=fineractmysql
|
- FINERACT_DEFAULT_TENANTDB_HOSTNAME=fineractmysql
|
||||||
- FINERACT_DEFAULT_TENANTDB_PORT=3306
|
- FINERACT_DEFAULT_TENANTDB_PORT=3306
|
||||||
- FINERACT_DEFAULT_TENANTDB_UID=root
|
- FINERACT_DEFAULT_TENANTDB_UID=root
|
||||||
- FINERACT_DEFAULT_TENANTDB_PWD=skdcnwauicn2ucnaecasdsajdnizucawencascdca
|
- FINERACT_DEFAULT_TENANTDB_PWD=skdcnwauicn2ucnaecasdsajdnizucawencascdca
|
||||||
- FINERACT_DEFAULT_TENANTDB_CONN_PARAMS=
|
- FINERACT_DEFAULT_TENANTDB_CONN_PARAMS=
|
||||||
|
- FINERACT_DEFAULT_TENANTDB_TIMEZONE=Asia/Kolkata
|
||||||
|
- FINERACT_DEFAULT_TENANTDB_IDENTIFIER=default
|
||||||
|
- FINERACT_DEFAULT_TENANTDB_NAME=fineract_default
|
||||||
|
- FINERACT_DEFAULT_TENANTDB_DESCRIPTION=Default Demo Tenant
|
||||||
|
|
||||||
# Frontend service
|
# Frontend service
|
||||||
community-app:
|
community-app:
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ configurations {
|
|||||||
driver
|
driver
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
driver 'org.mariadb.jdbc:mariadb-java-client:2.7.3'
|
driver 'org.mariadb.jdbc:mariadb-java-client:2.7.4'
|
||||||
}
|
}
|
||||||
|
|
||||||
URLClassLoader loader = GroovyObject.class.classLoader
|
URLClassLoader loader = GroovyObject.class.classLoader
|
||||||
@@ -238,7 +238,7 @@ bootRun {
|
|||||||
]
|
]
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'org.mariadb.jdbc:mariadb-java-client:2.7.3'
|
implementation 'org.mariadb.jdbc:mariadb-java-client:2.7.4'
|
||||||
}
|
}
|
||||||
|
|
||||||
classpath += files("build/generated/swagger-ui")
|
classpath += files("build/generated/swagger-ui")
|
||||||
@@ -316,7 +316,7 @@ jib {
|
|||||||
allowInsecureRegistries = true
|
allowInsecureRegistries = true
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'org.mariadb.jdbc:mariadb-java-client:2.7.3'
|
implementation 'org.mariadb.jdbc:mariadb-java-client:2.7.4'
|
||||||
}
|
}
|
||||||
|
|
||||||
extraDirectories {
|
extraDirectories {
|
||||||
|
|||||||
+3
-2
@@ -18,6 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.core.boot;
|
package org.apache.fineract.infrastructure.core.boot;
|
||||||
|
|
||||||
|
import org.apache.fineract.infrastructure.core.config.FineractProperties;
|
||||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||||
import org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration;
|
import org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration;
|
||||||
import org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration;
|
import org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration;
|
||||||
@@ -25,9 +26,9 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
|||||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration;
|
import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration;
|
||||||
import org.springframework.boot.autoconfigure.jdbc.JdbcTemplateAutoConfiguration;
|
import org.springframework.boot.autoconfigure.jdbc.JdbcTemplateAutoConfiguration;
|
||||||
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
|
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
|
||||||
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
import org.springframework.context.annotation.ComponentScan;
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.context.annotation.PropertySource;
|
|
||||||
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
||||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||||
|
|
||||||
@@ -36,12 +37,12 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
@PropertySource(value = "classpath:META-INF/spring/jdbc.properties")
|
|
||||||
@EnableAutoConfiguration(exclude = { DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class,
|
@EnableAutoConfiguration(exclude = { DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class,
|
||||||
DataSourceTransactionManagerAutoConfiguration.class, FlywayAutoConfiguration.class, GsonAutoConfiguration.class,
|
DataSourceTransactionManagerAutoConfiguration.class, FlywayAutoConfiguration.class, GsonAutoConfiguration.class,
|
||||||
JdbcTemplateAutoConfiguration.class })
|
JdbcTemplateAutoConfiguration.class })
|
||||||
@EnableTransactionManagement
|
@EnableTransactionManagement
|
||||||
@EnableWebSecurity
|
@EnableWebSecurity
|
||||||
|
@EnableConfigurationProperties({ FineractProperties.class })
|
||||||
@ComponentScan(basePackages = "org.apache.fineract.**")
|
@ComponentScan(basePackages = "org.apache.fineract.**")
|
||||||
public abstract class AbstractApplicationConfiguration {
|
public abstract class AbstractApplicationConfiguration {
|
||||||
|
|
||||||
|
|||||||
-61
@@ -1,61 +0,0 @@
|
|||||||
/**
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing,
|
|
||||||
* software distributed under the License is distributed on an
|
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
* KIND, either express or implied. See the License for the
|
|
||||||
* specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*/
|
|
||||||
package org.apache.fineract.infrastructure.core.boot;
|
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.context.ApplicationContext;
|
|
||||||
import org.springframework.core.env.Environment;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class JDBCDriverConfig {
|
|
||||||
|
|
||||||
private static final String DRIVER_CLASS_PROPERTYNAME = "DRIVERCLASS_NAME";
|
|
||||||
private static final String PROTOCOL_PROPERTYNAME = "PROTOCOL";
|
|
||||||
private static final String SUBPROTOCOL_PROPERTYNAME = "SUB_PROTOCOL";
|
|
||||||
|
|
||||||
private String driverClassName;
|
|
||||||
private String protocol;
|
|
||||||
private String subProtocol;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
ApplicationContext context;
|
|
||||||
|
|
||||||
@PostConstruct
|
|
||||||
protected void init() {
|
|
||||||
Environment environment = context.getEnvironment();
|
|
||||||
driverClassName = environment.getProperty(DRIVER_CLASS_PROPERTYNAME);
|
|
||||||
protocol = environment.getProperty(PROTOCOL_PROPERTYNAME);
|
|
||||||
subProtocol = environment.getProperty(SUBPROTOCOL_PROPERTYNAME);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDriverClassName() {
|
|
||||||
return this.driverClassName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String constructProtocol(String schemaServer, String schemaServerPort, String schemaName, String schemaConnectionParameters) {
|
|
||||||
StringBuilder sb = new StringBuilder(protocol).append(":").append(subProtocol).append("://").append(schemaServer).append(":")
|
|
||||||
.append(schemaServerPort).append('/').append(schemaName);
|
|
||||||
if (schemaConnectionParameters != null && !schemaConnectionParameters.isEmpty()) {
|
|
||||||
sb.append('?').append(schemaConnectionParameters);
|
|
||||||
}
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+151
@@ -0,0 +1,151 @@
|
|||||||
|
/**
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.apache.fineract.infrastructure.core.config;
|
||||||
|
|
||||||
|
import com.zaxxer.hikari.HikariConfig;
|
||||||
|
import com.zaxxer.hikari.HikariDataSource;
|
||||||
|
import java.util.Properties;
|
||||||
|
import javax.annotation.PostConstruct;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.core.env.Environment;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@ConditionalOnExpression("#{ systemEnvironment['fineract_tenants_driver'] != null }")
|
||||||
|
@Deprecated // NOTE: this will be removed in one of the next releases (probably around version 1.7.x or 1.8.x)
|
||||||
|
public class CompatibilityConfig {
|
||||||
|
|
||||||
|
private static final Logger LOG = LoggerFactory.getLogger(CompatibilityConfig.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
ApplicationContext context;
|
||||||
|
|
||||||
|
@PostConstruct
|
||||||
|
public void init() {
|
||||||
|
Environment environment = context.getEnvironment();
|
||||||
|
|
||||||
|
LOG.warn("===============================================================================================\n");
|
||||||
|
LOG.warn("You are using a deprecated tenant DB configuration:\n");
|
||||||
|
LOG.warn("- Env var 'fineract_tenants_driver': {}",
|
||||||
|
environment.getProperty("fineract_tenants_driver"));
|
||||||
|
LOG.warn("- Env var 'fineract_tenants_url': {}",
|
||||||
|
environment.getProperty("fineract_tenants_url"));
|
||||||
|
LOG.warn("- Env var 'fineract_tenants_uid': {}",
|
||||||
|
environment.getProperty("fineract_tenants_uid"));
|
||||||
|
LOG.warn("- Env var 'fineract_tenants_pwd': ****\n");
|
||||||
|
LOG.warn("The preferred way to configure the tenant DB is now via these environment variables:\n");
|
||||||
|
LOG.warn("- Env var 'FINERACT_HIKARI_DRIVER_SOURCE_CLASS_NAME': {}",
|
||||||
|
environment.getProperty("FINERACT_HIKARI_DRIVER_SOURCE_CLASS_NAME"));
|
||||||
|
LOG.warn("- Env var 'FINERACT_HIKARI_JDBC_URL': {}",
|
||||||
|
environment.getProperty("FINERACT_HIKARI_JDBC_URL"));
|
||||||
|
LOG.warn("- Env var 'FINERACT_HIKARI_USERNAME': {}",
|
||||||
|
environment.getProperty("FINERACT_HIKARI_USERNAME"));
|
||||||
|
LOG.warn("- Env var 'FINERACT_HIKARI_PASSWORD': ****");
|
||||||
|
LOG.warn("- Env var 'FINERACT_HIKARI_MINIMUM_IDLE': {}",
|
||||||
|
environment.getProperty("FINERACT_HIKARI_MINIMUM_IDLE"));
|
||||||
|
LOG.warn("- Env var 'FINERACT_HIKARI_MAXIMUM_POOL_SIZE': {}",
|
||||||
|
environment.getProperty("FINERACT_HIKARI_MAXIMUM_POOL_SIZE"));
|
||||||
|
LOG.warn("- Env var 'FINERACT_HIKARI_IDLE_TIMEOUT': {}",
|
||||||
|
environment.getProperty("FINERACT_HIKARI_IDLE_TIMEOUT"));
|
||||||
|
LOG.warn("- Env var 'FINERACT_HIKARI_CONNECTION_TIMEOUT': {}",
|
||||||
|
environment.getProperty("FINERACT_HIKARI_CONNECTION_TIMEOUT"));
|
||||||
|
LOG.warn("- Env var 'FINERACT_HIKARI_TEST_QUERY': {}",
|
||||||
|
environment.getProperty("FINERACT_HIKARI_TEST_QUERY"));
|
||||||
|
LOG.warn("- Env var 'FINERACT_HIKARI_AUTO_COMMIT': {}",
|
||||||
|
environment.getProperty("FINERACT_HIKARI_AUTO_COMMIT"));
|
||||||
|
LOG.warn("- Env var 'FINERACT_HIKARI_DS_PROPERTIES_CACHE_PREP_STMTS': {}",
|
||||||
|
environment.getProperty("FINERACT_HIKARI_DS_PROPERTIES_CACHE_PREP_STMTS"));
|
||||||
|
LOG.warn("- Env var 'FINERACT_HIKARI_DS_PROPERTIES_PREP_STMT_CACHE_SIZE': {}",
|
||||||
|
environment.getProperty("FINERACT_HIKARI_DS_PROPERTIES_PREP_STMT_CACHE_SIZE"));
|
||||||
|
LOG.warn("- Env var 'FINERACT_HIKARI_DS_PROPERTIES_PREP_STMT_CACHE_SQL_LIMIT': {}",
|
||||||
|
environment.getProperty("FINERACT_HIKARI_DS_PROPERTIES_PREP_STMT_CACHE_SQL_LIMIT"));
|
||||||
|
LOG.warn("- Env var 'FINERACT_HIKARI_DS_PROPERTIES_USE_SERVER_PREP_STMTS': {}",
|
||||||
|
environment.getProperty("FINERACT_HIKARI_DS_PROPERTIES_USE_SERVER_PREP_STMTS"));
|
||||||
|
LOG.warn("- Env var 'FINERACT_HIKARI_DS_PROPERTIES_USE_LOCAL_SESSION_STATE': {}",
|
||||||
|
environment.getProperty("FINERACT_HIKARI_DS_PROPERTIES_USE_LOCAL_SESSION_STATE"));
|
||||||
|
LOG.warn("- Env var 'FINERACT_HIKARI_DS_PROPERTIES_REWRITE_BATCHED_STATEMENTS': {}",
|
||||||
|
environment.getProperty("FINERACT_HIKARI_DS_PROPERTIES_REWRITE_BATCHED_STATEMENTS"));
|
||||||
|
LOG.warn("- Env var 'FINERACT_HIKARI_DS_PROPERTIES_CACHE_RESULT_SET_METADATA': {}",
|
||||||
|
environment.getProperty("FINERACT_HIKARI_DS_PROPERTIES_CACHE_RESULT_SET_METADATA"));
|
||||||
|
LOG.warn("- Env var 'FINERACT_HIKARI_DS_PROPERTIES_CACHE_SERVER_CONFIGURATION': {}",
|
||||||
|
environment.getProperty("FINERACT_HIKARI_DS_PROPERTIES_CACHE_SERVER_CONFIGURATION"));
|
||||||
|
LOG.warn("- Env var 'FINERACT_HIKARI_DS_PROPERTIES_ELIDE_SET_AUTO_COMMITS': {}",
|
||||||
|
environment.getProperty("FINERACT_HIKARI_DS_PROPERTIES_ELIDE_SET_AUTO_COMMITS"));
|
||||||
|
LOG.warn("- Env var 'FINERACT_HIKARI_DS_PROPERTIES_MAINTAIN_TIME_STATS': {}",
|
||||||
|
environment.getProperty("FINERACT_HIKARI_DS_PROPERTIES_MAINTAIN_TIME_STATS"));
|
||||||
|
LOG.warn("- Env var 'FINERACT_HIKARI_DS_PROPERTIES_LOG_SLOW_QUERIES': {}",
|
||||||
|
environment.getProperty("FINERACT_HIKARI_DS_PROPERTIES_LOG_SLOW_QUERIES"));
|
||||||
|
LOG.warn("- Env var 'FINERACT_HIKARI_DS_PROPERTIES_DUMP_QUERIES_IN_EXCEPTION': {}",
|
||||||
|
environment.getProperty("FINERACT_HIKARI_DS_PROPERTIES_DUMP_QUERIES_IN_EXCEPTION"));
|
||||||
|
LOG.warn("===============================================================================================\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean(destroyMethod = "close")
|
||||||
|
public HikariDataSource hikariTenantDataSource(HikariConfig hc) {
|
||||||
|
return new HikariDataSource(hc);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public HikariConfig hikariConfig() {
|
||||||
|
Environment environment = context.getEnvironment();
|
||||||
|
HikariConfig hc = new HikariConfig();
|
||||||
|
|
||||||
|
hc.setDriverClassName(environment.getProperty("fineract_tenants_driver"));
|
||||||
|
hc.setJdbcUrl(environment.getProperty("fineract_tenants_url"));
|
||||||
|
hc.setUsername(environment.getProperty("fineract_tenants_uid"));
|
||||||
|
hc.setPassword(environment.getProperty("fineract_tenants_pwd"));
|
||||||
|
hc.setMinimumIdle(3);
|
||||||
|
hc.setMaximumPoolSize(10);
|
||||||
|
hc.setIdleTimeout(60000);
|
||||||
|
hc.setConnectionTestQuery("SELECT 1");
|
||||||
|
hc.setDataSourceProperties(dataSourceProperties());
|
||||||
|
|
||||||
|
return hc;
|
||||||
|
}
|
||||||
|
|
||||||
|
// These are the properties for the all Tenants DB; the same configuration is also (hard-coded) in the
|
||||||
|
// TomcatJdbcDataSourcePerTenantService class -->
|
||||||
|
private Properties dataSourceProperties() {
|
||||||
|
Properties props = new Properties();
|
||||||
|
|
||||||
|
props.setProperty("cachePrepStmts", "true");
|
||||||
|
props.setProperty("prepStmtCacheSize", "250");
|
||||||
|
props.setProperty("prepStmtCacheSqlLimit", "2048");
|
||||||
|
props.setProperty("useServerPrepStmts", "true");
|
||||||
|
props.setProperty("useLocalSessionState", "true");
|
||||||
|
props.setProperty("rewriteBatchedStatements", "true");
|
||||||
|
props.setProperty("cacheResultSetMetadata", "true");
|
||||||
|
props.setProperty("cacheServerConfiguration", "true");
|
||||||
|
props.setProperty("elideSetAutoCommits", "true");
|
||||||
|
props.setProperty("maintainTimeStats", "false");
|
||||||
|
|
||||||
|
// https://github.com/brettwooldridge/HikariCP/wiki/JDBC-Logging#mysql-connectorj
|
||||||
|
// TODO FINERACT-890: <prop key="logger">com.mysql.cj.log.Slf4JLogger</prop>
|
||||||
|
props.setProperty("logSlowQueries", "true");
|
||||||
|
props.setProperty("dumpQueriesOnException", "true");
|
||||||
|
|
||||||
|
return props;
|
||||||
|
}
|
||||||
|
}
|
||||||
+131
@@ -0,0 +1,131 @@
|
|||||||
|
/**
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.apache.fineract.infrastructure.core.config;
|
||||||
|
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
|
||||||
|
@ConfigurationProperties(prefix = "fineract")
|
||||||
|
public class FineractProperties {
|
||||||
|
|
||||||
|
private String nodeId;
|
||||||
|
|
||||||
|
private FineractTenantProperties tenant;
|
||||||
|
|
||||||
|
public String getNodeId() {
|
||||||
|
return nodeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNodeId(String nodeId) {
|
||||||
|
this.nodeId = nodeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FineractTenantProperties getTenant() {
|
||||||
|
return tenant;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTenant(FineractTenantProperties tenant) {
|
||||||
|
this.tenant = tenant;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class FineractTenantProperties {
|
||||||
|
|
||||||
|
private String host;
|
||||||
|
private Integer port;
|
||||||
|
private String username;
|
||||||
|
private String password;
|
||||||
|
private String parameters;
|
||||||
|
private String timezone;
|
||||||
|
private String identifier;
|
||||||
|
private String name;
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
public String getHost() {
|
||||||
|
return host;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHost(String host) {
|
||||||
|
this.host = host;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getPort() {
|
||||||
|
return port;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPort(Integer port) {
|
||||||
|
this.port = port;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUsername() {
|
||||||
|
return username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsername(String username) {
|
||||||
|
this.username = username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPassword() {
|
||||||
|
return password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPassword(String password) {
|
||||||
|
this.password = password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getParameters() {
|
||||||
|
return parameters;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParameters(String parameters) {
|
||||||
|
this.parameters = parameters;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTimezone() {
|
||||||
|
return timezone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTimezone(String timezone) {
|
||||||
|
this.timezone = timezone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIdentifier() {
|
||||||
|
return identifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIdentifier(String identifier) {
|
||||||
|
this.identifier = identifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+11
-47
@@ -21,63 +21,27 @@ package org.apache.fineract.infrastructure.core.config;
|
|||||||
|
|
||||||
import com.zaxxer.hikari.HikariConfig;
|
import com.zaxxer.hikari.HikariConfig;
|
||||||
import com.zaxxer.hikari.HikariDataSource;
|
import com.zaxxer.hikari.HikariDataSource;
|
||||||
import java.util.Properties;
|
import javax.sql.DataSource;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
|
||||||
import org.springframework.context.ApplicationContext;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.core.env.Environment;
|
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
|
@ConditionalOnExpression("#{ systemEnvironment['fineract_tenants_driver'] == null }")
|
||||||
public class HikariCpConfig {
|
public class HikariCpConfig {
|
||||||
|
|
||||||
@Autowired
|
// TODO: we can get rid of this config class by defining "spring.hikariTenantDataSource.hikari.*" in
|
||||||
ApplicationContext context;
|
// "application.properties" and enabling auto-configuration
|
||||||
|
|
||||||
@Bean(destroyMethod = "close")
|
|
||||||
public HikariDataSource hikariTenantDataSource(HikariConfig hc) {
|
|
||||||
return new HikariDataSource(hc);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
@ConfigurationProperties(prefix = "spring.datasource.hikari")
|
||||||
public HikariConfig hikariConfig() {
|
public HikariConfig hikariConfig() {
|
||||||
Environment environment = context.getEnvironment();
|
return new HikariConfig();
|
||||||
HikariConfig hc = new HikariConfig();
|
|
||||||
|
|
||||||
hc.setDriverClassName(environment.getProperty("fineract_tenants_driver"));
|
|
||||||
hc.setJdbcUrl(environment.getProperty("fineract_tenants_url"));
|
|
||||||
hc.setUsername(environment.getProperty("fineract_tenants_uid"));
|
|
||||||
hc.setPassword(environment.getProperty("fineract_tenants_pwd"));
|
|
||||||
hc.setMinimumIdle(3);
|
|
||||||
hc.setMaximumPoolSize(10);
|
|
||||||
hc.setIdleTimeout(60000);
|
|
||||||
hc.setConnectionTestQuery("SELECT 1");
|
|
||||||
hc.setDataSourceProperties(dataSourceProperties());
|
|
||||||
|
|
||||||
return hc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// These are the properties for the all Tenants DB; the same configuration is also (hard-coded) in the
|
@Bean(destroyMethod = "close")
|
||||||
// TomcatJdbcDataSourcePerTenantService class -->
|
public DataSource hikariTenantDataSource(HikariConfig hikariConfig) {
|
||||||
private Properties dataSourceProperties() {
|
return new HikariDataSource(hikariConfig);
|
||||||
Properties props = new Properties();
|
|
||||||
|
|
||||||
props.setProperty("cachePrepStmts", "true");
|
|
||||||
props.setProperty("prepStmtCacheSize", "250");
|
|
||||||
props.setProperty("prepStmtCacheSqlLimit", "2048");
|
|
||||||
props.setProperty("useServerPrepStmts", "true");
|
|
||||||
props.setProperty("useLocalSessionState", "true");
|
|
||||||
props.setProperty("rewriteBatchedStatements", "true");
|
|
||||||
props.setProperty("cacheResultSetMetadata", "true");
|
|
||||||
props.setProperty("cacheServerConfiguration", "true");
|
|
||||||
props.setProperty("elideSetAutoCommits", "true");
|
|
||||||
props.setProperty("maintainTimeStats", "false");
|
|
||||||
|
|
||||||
// https://github.com/brettwooldridge/HikariCP/wiki/JDBC-Logging#mysql-connectorj
|
|
||||||
// TODO FINERACT-890: <prop key="logger">com.mysql.cj.log.Slf4JLogger</prop>
|
|
||||||
props.setProperty("logSlowQueries", "true");
|
|
||||||
props.setProperty("dumpQueriesOnException", "true");
|
|
||||||
|
|
||||||
return props;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+22
@@ -18,6 +18,9 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.core.domain;
|
package org.apache.fineract.infrastructure.core.domain;
|
||||||
|
|
||||||
|
import javax.sql.DataSource;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds Tenant's DB server connection connection details.
|
* Holds Tenant's DB server connection connection details.
|
||||||
*/
|
*/
|
||||||
@@ -181,4 +184,23 @@ public class FineractPlatformTenantConnection {
|
|||||||
}
|
}
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String toJdbcUrl(String protocol, String host, String port, String db, String parameters) {
|
||||||
|
StringBuilder sb = new StringBuilder(protocol).append("://").append(host).append(":").append(port).append('/').append(db);
|
||||||
|
|
||||||
|
if (!StringUtils.isEmpty(parameters)) {
|
||||||
|
sb.append('?').append(parameters);
|
||||||
|
}
|
||||||
|
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String toProtocol(DataSource dataSource) {
|
||||||
|
try {
|
||||||
|
String url = dataSource.getConnection().getMetaData().getURL();
|
||||||
|
return url.substring(0, url.indexOf("://"));
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
-44
@@ -1,44 +0,0 @@
|
|||||||
/**
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing,
|
|
||||||
* software distributed under the License is distributed on an
|
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
* KIND, either express or implied. See the License for the
|
|
||||||
* specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*/
|
|
||||||
package org.apache.fineract.infrastructure.core.service;
|
|
||||||
|
|
||||||
import javax.sql.DataSource;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Implementation that returns connection pool datasource for tenants database
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class DataSourceForTenants implements RoutingDataSourceService {
|
|
||||||
|
|
||||||
private final DataSource tenantDataSource;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
public DataSourceForTenants(final @Qualifier("hikariTenantDataSource") DataSource tenantDataSource) {
|
|
||||||
this.tenantDataSource = tenantDataSource;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public DataSource retrieveDataSource() {
|
|
||||||
return this.tenantDataSource;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
+31
-27
@@ -18,11 +18,15 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.core.service;
|
package org.apache.fineract.infrastructure.core.service;
|
||||||
|
|
||||||
|
import static org.apache.fineract.infrastructure.core.domain.FineractPlatformTenantConnection.toJdbcUrl;
|
||||||
|
import static org.apache.fineract.infrastructure.core.domain.FineractPlatformTenantConnection.toProtocol;
|
||||||
|
|
||||||
|
import com.zaxxer.hikari.HikariConfig;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
import org.apache.fineract.infrastructure.core.boot.JDBCDriverConfig;
|
import org.apache.fineract.infrastructure.core.config.FineractProperties;
|
||||||
import org.apache.fineract.infrastructure.core.domain.FineractPlatformTenant;
|
import org.apache.fineract.infrastructure.core.domain.FineractPlatformTenant;
|
||||||
import org.apache.fineract.infrastructure.core.domain.FineractPlatformTenantConnection;
|
import org.apache.fineract.infrastructure.core.domain.FineractPlatformTenantConnection;
|
||||||
import org.apache.fineract.infrastructure.security.service.TenantDetailsService;
|
import org.apache.fineract.infrastructure.security.service.TenantDetailsService;
|
||||||
@@ -45,17 +49,18 @@ public class TenantDatabaseUpgradeService {
|
|||||||
|
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(TenantDatabaseUpgradeService.class);
|
private static final Logger LOG = LoggerFactory.getLogger(TenantDatabaseUpgradeService.class);
|
||||||
|
|
||||||
|
private final HikariConfig hikariConfig;
|
||||||
private final TenantDetailsService tenantDetailsService;
|
private final TenantDetailsService tenantDetailsService;
|
||||||
protected final DataSource tenantDataSource;
|
protected final DataSource tenantDataSource;
|
||||||
|
protected final FineractProperties fineractProperties;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private JDBCDriverConfig driverConfig;
|
public TenantDatabaseUpgradeService(final HikariConfig hikariConfig, final TenantDetailsService detailsService,
|
||||||
|
@Qualifier("hikariTenantDataSource") final DataSource dataSource, final FineractProperties fineractProperties) {
|
||||||
@Autowired
|
this.hikariConfig = hikariConfig;
|
||||||
public TenantDatabaseUpgradeService(final TenantDetailsService detailsService,
|
|
||||||
@Qualifier("hikariTenantDataSource") final DataSource dataSource) {
|
|
||||||
this.tenantDetailsService = detailsService;
|
this.tenantDetailsService = detailsService;
|
||||||
this.tenantDataSource = dataSource;
|
this.tenantDataSource = dataSource;
|
||||||
|
this.fineractProperties = fineractProperties;
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
@@ -66,11 +71,11 @@ public class TenantDatabaseUpgradeService {
|
|||||||
final FineractPlatformTenantConnection connection = tenant.getConnection();
|
final FineractPlatformTenantConnection connection = tenant.getConnection();
|
||||||
if (connection.isAutoUpdateEnabled()) {
|
if (connection.isAutoUpdateEnabled()) {
|
||||||
|
|
||||||
String connectionProtocol = driverConfig.constructProtocol(connection.getSchemaServer(), connection.getSchemaServerPort(),
|
String protocol = toProtocol(this.tenantDataSource);
|
||||||
|
String jdbcUrl = toJdbcUrl(protocol, connection.getSchemaServer(), connection.getSchemaServerPort(),
|
||||||
connection.getSchemaName(), connection.getSchemaConnectionParameters());
|
connection.getSchemaName(), connection.getSchemaConnectionParameters());
|
||||||
DriverDataSource source = new DriverDataSource(Thread.currentThread().getContextClassLoader(),
|
DriverDataSource source = new DriverDataSource(Thread.currentThread().getContextClassLoader(),
|
||||||
driverConfig.getDriverClassName(), connectionProtocol, connection.getSchemaUsername(),
|
hikariConfig.getDriverClassName(), jdbcUrl, connection.getSchemaUsername(), connection.getSchemaPassword());
|
||||||
connection.getSchemaPassword());
|
|
||||||
|
|
||||||
final Flyway flyway = Flyway.configure().dataSource(source).locations("sql/migrations/core_db").outOfOrder(true)
|
final Flyway flyway = Flyway.configure().dataSource(source).locations("sql/migrations/core_db").outOfOrder(true)
|
||||||
.placeholderReplacement(false).configuration(Map.of("flyway.table", "schema_version")) // FINERACT-979
|
.placeholderReplacement(false).configuration(Map.of("flyway.table", "schema_version")) // FINERACT-979
|
||||||
@@ -84,7 +89,7 @@ public class TenantDatabaseUpgradeService {
|
|||||||
flyway.repair();
|
flyway.repair();
|
||||||
flyway.migrate();
|
flyway.migrate();
|
||||||
} catch (FlywayException e) {
|
} catch (FlywayException e) {
|
||||||
String betterMessage = e.getMessage() + "; for Tenant DB URL: " + connectionProtocol + ", username: "
|
String betterMessage = e.getMessage() + "; for Tenant DB URL: " + jdbcUrl + ", username: "
|
||||||
+ connection.getSchemaUsername();
|
+ connection.getSchemaUsername();
|
||||||
throw new FlywayException(betterMessage, e);
|
throw new FlywayException(betterMessage, e);
|
||||||
}
|
}
|
||||||
@@ -96,18 +101,25 @@ public class TenantDatabaseUpgradeService {
|
|||||||
* Initializes, and if required upgrades (using Flyway) the Tenant DB itself.
|
* Initializes, and if required upgrades (using Flyway) the Tenant DB itself.
|
||||||
*/
|
*/
|
||||||
private void upgradeTenantDB() {
|
private void upgradeTenantDB() {
|
||||||
String dbHostname = getEnvVar("FINERACT_DEFAULT_TENANTDB_HOSTNAME", "localhost");
|
LOG.info("Upgrade tenant DB: {}:{}", fineractProperties.getTenant().getHost(), fineractProperties.getTenant().getPort());
|
||||||
String dbPort = getEnvVar("FINERACT_DEFAULT_TENANTDB_PORT", "3306");
|
LOG.info("- fineract.tenant.username: {}", fineractProperties.getTenant().getUsername());
|
||||||
String dbUid = getEnvVar("FINERACT_DEFAULT_TENANTDB_UID", "root");
|
LOG.info("- fineract.tenant.password: ****");
|
||||||
String dbPwd = getEnvVar("FINERACT_DEFAULT_TENANTDB_PWD", "mysql");
|
LOG.info("- fineract.tenant.parameters: {}", fineractProperties.getTenant().getParameters());
|
||||||
String dbConnParams = getEnvVar("FINERACT_DEFAULT_TENANTDB_CONN_PARAMS", "");
|
LOG.info("- fineract.tenant.timezone: {}", fineractProperties.getTenant().getTimezone());
|
||||||
LOG.info("upgradeTenantDB: FINERACT_DEFAULT_TENANTDB_HOSTNAME = {}, FINERACT_DEFAULT_TENANTDB_PORT = {}", dbHostname, dbPort);
|
LOG.info("- fineract.tenant.description: {}", fineractProperties.getTenant().getDescription());
|
||||||
|
LOG.info("- fineract.tenant.identifier: {}", fineractProperties.getTenant().getIdentifier());
|
||||||
|
LOG.info("- fineract.tenant.name: {}", fineractProperties.getTenant().getName());
|
||||||
|
|
||||||
final Flyway flyway = Flyway.configure().dataSource(tenantDataSource).locations("sql/migrations/list_db").outOfOrder(true)
|
final Flyway flyway = Flyway.configure().dataSource(tenantDataSource).locations("sql/migrations/list_db").outOfOrder(true)
|
||||||
// FINERACT-773
|
// FINERACT-773
|
||||||
.placeholders(Map.of("fineract_default_tenantdb_hostname", dbHostname, "fineract_default_tenantdb_port", dbPort,
|
.placeholders(Map.of("fineract.tenant.host", fineractProperties.getTenant().getHost(), "fineract.tenant.port",
|
||||||
"fineract_default_tenantdb_uid", dbUid, "fineract_default_tenantdb_pwd", dbPwd,
|
fineractProperties.getTenant().getPort().toString(), "fineract.tenant.username",
|
||||||
"fineract_default_tenantdb_conn_params", dbConnParams))
|
fineractProperties.getTenant().getUsername(), "fineract.tenant.password",
|
||||||
|
fineractProperties.getTenant().getPassword(), "fineract.tenant.parameters",
|
||||||
|
fineractProperties.getTenant().getParameters(), "fineract.tenant.timezone",
|
||||||
|
fineractProperties.getTenant().getTimezone(), "fineract.tenant.description",
|
||||||
|
fineractProperties.getTenant().getDescription(), "fineract.tenant.identifier",
|
||||||
|
fineractProperties.getTenant().getIdentifier(), "fineract.tenant.name", fineractProperties.getTenant().getName()))
|
||||||
.configuration(Map.of("flyway.table", "schema_version")) // FINERACT-979
|
.configuration(Map.of("flyway.table", "schema_version")) // FINERACT-979
|
||||||
.load();
|
.load();
|
||||||
|
|
||||||
@@ -119,14 +131,6 @@ public class TenantDatabaseUpgradeService {
|
|||||||
flyway.migrate();
|
flyway.migrate();
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getEnvVar(String name, String defaultValue) {
|
|
||||||
String value = System.getenv(name);
|
|
||||||
if (value == null) {
|
|
||||||
return defaultValue;
|
|
||||||
}
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void repairFlywayVersionSkip(DataSource source) {
|
private void repairFlywayVersionSkip(DataSource source) {
|
||||||
JdbcTemplate template = new JdbcTemplate(source);
|
JdbcTemplate template = new JdbcTemplate(source);
|
||||||
LOG.info("repairFlywayVersionSkip: Check whether the version table is in old format ");
|
LOG.info("repairFlywayVersionSkip: Check whether the version table is in old format ");
|
||||||
|
|||||||
+11
-24
@@ -18,12 +18,14 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.core.service;
|
package org.apache.fineract.infrastructure.core.service;
|
||||||
|
|
||||||
|
import static org.apache.fineract.infrastructure.core.domain.FineractPlatformTenantConnection.toJdbcUrl;
|
||||||
|
import static org.apache.fineract.infrastructure.core.domain.FineractPlatformTenantConnection.toProtocol;
|
||||||
|
|
||||||
import com.zaxxer.hikari.HikariConfig;
|
import com.zaxxer.hikari.HikariConfig;
|
||||||
import com.zaxxer.hikari.HikariDataSource;
|
import com.zaxxer.hikari.HikariDataSource;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
import org.apache.fineract.infrastructure.core.boot.JDBCDriverConfig;
|
|
||||||
import org.apache.fineract.infrastructure.core.domain.FineractPlatformTenant;
|
import org.apache.fineract.infrastructure.core.domain.FineractPlatformTenant;
|
||||||
import org.apache.fineract.infrastructure.core.domain.FineractPlatformTenantConnection;
|
import org.apache.fineract.infrastructure.core.domain.FineractPlatformTenantConnection;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -43,7 +45,7 @@ public class TomcatJdbcDataSourcePerTenantService implements RoutingDataSourceSe
|
|||||||
private final DataSource tenantDataSource;
|
private final DataSource tenantDataSource;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private JDBCDriverConfig driverConfig;
|
private HikariConfig hikariConfig;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public TomcatJdbcDataSourcePerTenantService(final @Qualifier("hikariTenantDataSource") DataSource tenantDataSource) {
|
public TomcatJdbcDataSourcePerTenantService(final @Qualifier("hikariTenantDataSource") DataSource tenantDataSource) {
|
||||||
@@ -77,21 +79,21 @@ public class TomcatJdbcDataSourcePerTenantService implements RoutingDataSourceSe
|
|||||||
|
|
||||||
// creates the tenant data source for the oltp and report database
|
// creates the tenant data source for the oltp and report database
|
||||||
private DataSource createNewDataSourceFor(final FineractPlatformTenantConnection tenantConnectionObj) {
|
private DataSource createNewDataSourceFor(final FineractPlatformTenantConnection tenantConnectionObj) {
|
||||||
String jdbcUrl = this.driverConfig.constructProtocol(tenantConnectionObj.getSchemaServer(),
|
String protocol = toProtocol(this.tenantDataSource);
|
||||||
tenantConnectionObj.getSchemaServerPort(), tenantConnectionObj.getSchemaName(),
|
String jdbcUrl = toJdbcUrl(protocol, tenantConnectionObj.getSchemaServer(), tenantConnectionObj.getSchemaServerPort(),
|
||||||
tenantConnectionObj.getSchemaConnectionParameters());
|
tenantConnectionObj.getSchemaName(), tenantConnectionObj.getSchemaConnectionParameters());
|
||||||
|
|
||||||
HikariConfig config = new HikariConfig();
|
HikariConfig config = new HikariConfig();
|
||||||
config.setDriverClassName(this.driverConfig.getDriverClassName());
|
config.setDriverClassName(hikariConfig.getDriverClassName());
|
||||||
config.setPoolName(tenantConnectionObj.getSchemaName() + "_pool");
|
config.setPoolName(tenantConnectionObj.getSchemaName() + "_pool");
|
||||||
config.setJdbcUrl(jdbcUrl);
|
config.setJdbcUrl(jdbcUrl);
|
||||||
config.setUsername(tenantConnectionObj.getSchemaUsername());
|
config.setUsername(tenantConnectionObj.getSchemaUsername());
|
||||||
config.setPassword(tenantConnectionObj.getSchemaPassword());
|
config.setPassword(tenantConnectionObj.getSchemaPassword());
|
||||||
config.setMinimumIdle(tenantConnectionObj.getInitialSize());
|
config.setMinimumIdle(tenantConnectionObj.getInitialSize());
|
||||||
config.setMaximumPoolSize(tenantConnectionObj.getMaxActive());
|
config.setMaximumPoolSize(tenantConnectionObj.getMaxActive());
|
||||||
config.setConnectionTestQuery("SELECT 1");
|
config.setConnectionTestQuery(hikariConfig.getConnectionTestQuery());
|
||||||
config.setValidationTimeout(tenantConnectionObj.getValidationInterval());
|
config.setValidationTimeout(tenantConnectionObj.getValidationInterval());
|
||||||
config.setAutoCommit(true);
|
config.setAutoCommit(hikariConfig.isAutoCommit());
|
||||||
|
|
||||||
// https://github.com/brettwooldridge/HikariCP/wiki/MBean-(JMX)-Monitoring-and-Management
|
// https://github.com/brettwooldridge/HikariCP/wiki/MBean-(JMX)-Monitoring-and-Management
|
||||||
config.setRegisterMbeans(true);
|
config.setRegisterMbeans(true);
|
||||||
@@ -100,22 +102,7 @@ public class TomcatJdbcDataSourcePerTenantService implements RoutingDataSourceSe
|
|||||||
// These are the properties for each Tenant DB; the same configuration
|
// These are the properties for each Tenant DB; the same configuration
|
||||||
// is also in src/main/resources/META-INF/spring/hikariDataSource.xml
|
// is also in src/main/resources/META-INF/spring/hikariDataSource.xml
|
||||||
// for the all Tenants DB -->
|
// for the all Tenants DB -->
|
||||||
config.addDataSourceProperty("cachePrepStmts", "true");
|
config.setDataSourceProperties(hikariConfig.getDataSourceProperties());
|
||||||
config.addDataSourceProperty("prepStmtCacheSize", "250");
|
|
||||||
config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048");
|
|
||||||
config.addDataSourceProperty("useServerPrepStmts", "true");
|
|
||||||
config.addDataSourceProperty("useLocalSessionState", "true");
|
|
||||||
config.addDataSourceProperty("rewriteBatchedStatements", "true");
|
|
||||||
config.addDataSourceProperty("cacheResultSetMetadata", "true");
|
|
||||||
config.addDataSourceProperty("cacheServerConfiguration", "true");
|
|
||||||
config.addDataSourceProperty("elideSetAutoCommits", "true");
|
|
||||||
config.addDataSourceProperty("maintainTimeStats", "false");
|
|
||||||
|
|
||||||
// https://github.com/brettwooldridge/HikariCP/wiki/JDBC-Logging#mysql-connectorj
|
|
||||||
// TODO FINERACT-890: config.addDataSourceProperty("logger",
|
|
||||||
// "com.mysql.cj.log.Slf4JLogger");
|
|
||||||
config.addDataSourceProperty("logSlowQueries", "true");
|
|
||||||
config.addDataSourceProperty("dumpQueriesOnException", "true");
|
|
||||||
|
|
||||||
return new HikariDataSource(config);
|
return new HikariDataSource(config);
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-9
@@ -28,6 +28,7 @@ import java.util.Map;
|
|||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
|
import org.apache.fineract.infrastructure.core.config.FineractProperties;
|
||||||
import org.apache.fineract.infrastructure.core.domain.FineractPlatformTenant;
|
import org.apache.fineract.infrastructure.core.domain.FineractPlatformTenant;
|
||||||
import org.apache.fineract.infrastructure.core.exception.PlatformInternalServerException;
|
import org.apache.fineract.infrastructure.core.exception.PlatformInternalServerException;
|
||||||
import org.apache.fineract.infrastructure.core.service.ThreadLocalContextUtil;
|
import org.apache.fineract.infrastructure.core.service.ThreadLocalContextUtil;
|
||||||
@@ -51,7 +52,6 @@ import org.quartz.TriggerListener;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.context.ApplicationContext;
|
import org.springframework.context.ApplicationContext;
|
||||||
import org.springframework.context.ApplicationListener;
|
import org.springframework.context.ApplicationListener;
|
||||||
import org.springframework.context.event.ContextClosedEvent;
|
import org.springframework.context.event.ContextClosedEvent;
|
||||||
@@ -92,15 +92,16 @@ public class JobRegisterServiceImpl implements JobRegisterService, ApplicationLi
|
|||||||
// This cannot be injected as Autowired due to circular dependency
|
// This cannot be injected as Autowired due to circular dependency
|
||||||
private SchedulerStopListener schedulerStopListener = new SchedulerStopListener(this);
|
private SchedulerStopListener schedulerStopListener = new SchedulerStopListener(this);
|
||||||
|
|
||||||
@Value("${node_id:1}")
|
@Autowired
|
||||||
private String nodeId;
|
private FineractProperties fineractProperties;
|
||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void loadAllJobs() {
|
public void loadAllJobs() {
|
||||||
final List<FineractPlatformTenant> allTenants = this.tenantDetailsService.findAllTenants();
|
final List<FineractPlatformTenant> allTenants = this.tenantDetailsService.findAllTenants();
|
||||||
for (final FineractPlatformTenant tenant : allTenants) {
|
for (final FineractPlatformTenant tenant : allTenants) {
|
||||||
ThreadLocalContextUtil.setTenant(tenant);
|
ThreadLocalContextUtil.setTenant(tenant);
|
||||||
final List<ScheduledJobDetail> scheduledJobDetails = this.schedularWritePlatformService.retrieveAllJobs(nodeId);
|
final List<ScheduledJobDetail> scheduledJobDetails = this.schedularWritePlatformService
|
||||||
|
.retrieveAllJobs(fineractProperties.getNodeId());
|
||||||
for (final ScheduledJobDetail jobDetails : scheduledJobDetails) {
|
for (final ScheduledJobDetail jobDetails : scheduledJobDetails) {
|
||||||
scheduleJob(jobDetails);
|
scheduleJob(jobDetails);
|
||||||
jobDetails.updateTriggerMisfired(false);
|
jobDetails.updateTriggerMisfired(false);
|
||||||
@@ -180,7 +181,8 @@ public class JobRegisterServiceImpl implements JobRegisterService, ApplicationLi
|
|||||||
schedulerDetail.updateSuspendedState(false);
|
schedulerDetail.updateSuspendedState(false);
|
||||||
this.schedularWritePlatformService.updateSchedulerDetail(schedulerDetail);
|
this.schedularWritePlatformService.updateSchedulerDetail(schedulerDetail);
|
||||||
if (schedulerDetail.isExecuteInstructionForMisfiredJobs()) {
|
if (schedulerDetail.isExecuteInstructionForMisfiredJobs()) {
|
||||||
final List<ScheduledJobDetail> scheduledJobDetails = this.schedularWritePlatformService.retrieveAllJobs(this.nodeId);
|
final List<ScheduledJobDetail> scheduledJobDetails = this.schedularWritePlatformService
|
||||||
|
.retrieveAllJobs(fineractProperties.getNodeId());
|
||||||
for (final ScheduledJobDetail jobDetail : scheduledJobDetails) {
|
for (final ScheduledJobDetail jobDetail : scheduledJobDetails) {
|
||||||
if (jobDetail.isTriggerMisfired()) {
|
if (jobDetail.isTriggerMisfired()) {
|
||||||
if (jobDetail.isActiveSchedular()) {
|
if (jobDetail.isActiveSchedular()) {
|
||||||
@@ -215,12 +217,12 @@ public class JobRegisterServiceImpl implements JobRegisterService, ApplicationLi
|
|||||||
public void rescheduleJob(final Long jobId) {
|
public void rescheduleJob(final Long jobId) {
|
||||||
final ScheduledJobDetail scheduledJobDetail = this.schedularWritePlatformService.findByJobId(jobId);
|
final ScheduledJobDetail scheduledJobDetail = this.schedularWritePlatformService.findByJobId(jobId);
|
||||||
final String nodeIdStored = scheduledJobDetail.getNodeId().toString();
|
final String nodeIdStored = scheduledJobDetail.getNodeId().toString();
|
||||||
if (nodeIdStored.equals(this.nodeId) || nodeIdStored.equals("0")) {
|
if (nodeIdStored.equals(fineractProperties.getNodeId()) || nodeIdStored.equals("0")) {
|
||||||
rescheduleJob(scheduledJobDetail);
|
rescheduleJob(scheduledJobDetail);
|
||||||
} else {
|
} else {
|
||||||
scheduledJobDetail.setIsMismatchedJob(true);
|
scheduledJobDetail.setIsMismatchedJob(true);
|
||||||
this.schedularWritePlatformService.saveOrUpdate(scheduledJobDetail);
|
this.schedularWritePlatformService.saveOrUpdate(scheduledJobDetail);
|
||||||
throw new JobNodeIdMismatchingException(nodeIdStored, this.nodeId);
|
throw new JobNodeIdMismatchingException(nodeIdStored, fineractProperties.getNodeId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -232,12 +234,12 @@ public class JobRegisterServiceImpl implements JobRegisterService, ApplicationLi
|
|||||||
}
|
}
|
||||||
final String nodeIdStored = scheduledJobDetail.getNodeId().toString();
|
final String nodeIdStored = scheduledJobDetail.getNodeId().toString();
|
||||||
|
|
||||||
if (nodeIdStored.equals(this.nodeId) || nodeIdStored.equals("0")) {
|
if (nodeIdStored.equals(fineractProperties.getNodeId()) || nodeIdStored.equals("0")) {
|
||||||
executeJob(scheduledJobDetail, null);
|
executeJob(scheduledJobDetail, null);
|
||||||
} else {
|
} else {
|
||||||
scheduledJobDetail.setIsMismatchedJob(true);
|
scheduledJobDetail.setIsMismatchedJob(true);
|
||||||
this.schedularWritePlatformService.saveOrUpdate(scheduledJobDetail);
|
this.schedularWritePlatformService.saveOrUpdate(scheduledJobDetail);
|
||||||
throw new JobNodeIdMismatchingException(nodeIdStored, this.nodeId);
|
throw new JobNodeIdMismatchingException(nodeIdStored, fineractProperties.getNodeId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
-6
@@ -32,6 +32,7 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.apache.fineract.accounting.glaccount.domain.TrialBalance;
|
import org.apache.fineract.accounting.glaccount.domain.TrialBalance;
|
||||||
import org.apache.fineract.accounting.glaccount.domain.TrialBalanceRepositoryWrapper;
|
import org.apache.fineract.accounting.glaccount.domain.TrialBalanceRepositoryWrapper;
|
||||||
|
import org.apache.fineract.infrastructure.core.config.FineractProperties;
|
||||||
import org.apache.fineract.infrastructure.core.data.ApiParameterError;
|
import org.apache.fineract.infrastructure.core.data.ApiParameterError;
|
||||||
import org.apache.fineract.infrastructure.core.exception.PlatformApiDataValidationException;
|
import org.apache.fineract.infrastructure.core.exception.PlatformApiDataValidationException;
|
||||||
import org.apache.fineract.infrastructure.core.service.DateUtils;
|
import org.apache.fineract.infrastructure.core.service.DateUtils;
|
||||||
@@ -56,7 +57,6 @@ import org.apache.fineract.portfolio.shareaccounts.service.ShareAccountSchedular
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.jdbc.core.JdbcTemplate;
|
import org.springframework.jdbc.core.JdbcTemplate;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -81,9 +81,7 @@ public class ScheduledJobRunnerServiceImpl implements ScheduledJobRunnerService
|
|||||||
private final TrialBalanceRepositoryWrapper trialBalanceRepositoryWrapper;
|
private final TrialBalanceRepositoryWrapper trialBalanceRepositoryWrapper;
|
||||||
private final JobRegisterService jobRegisterService;
|
private final JobRegisterService jobRegisterService;
|
||||||
private final ScheduledJobDetailRepository scheduledJobDetailsRepository;
|
private final ScheduledJobDetailRepository scheduledJobDetailsRepository;
|
||||||
|
private final FineractProperties fineractProperties;
|
||||||
@Value("${node_id:1}")
|
|
||||||
private String nodeId;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public ScheduledJobRunnerServiceImpl(final RoutingDataSourceServiceFactory dataSourceServiceFactory,
|
public ScheduledJobRunnerServiceImpl(final RoutingDataSourceServiceFactory dataSourceServiceFactory,
|
||||||
@@ -94,7 +92,7 @@ public class ScheduledJobRunnerServiceImpl implements ScheduledJobRunnerService
|
|||||||
final ShareAccountDividendReadPlatformService shareAccountDividendReadPlatformService,
|
final ShareAccountDividendReadPlatformService shareAccountDividendReadPlatformService,
|
||||||
final ShareAccountSchedularService shareAccountSchedularService,
|
final ShareAccountSchedularService shareAccountSchedularService,
|
||||||
final TrialBalanceRepositoryWrapper trialBalanceRepositoryWrapper, @Lazy final JobRegisterService jobRegisterService,
|
final TrialBalanceRepositoryWrapper trialBalanceRepositoryWrapper, @Lazy final JobRegisterService jobRegisterService,
|
||||||
final ScheduledJobDetailRepository scheduledJobDetailsRepository) {
|
final ScheduledJobDetailRepository scheduledJobDetailsRepository, final FineractProperties fineractProperties) {
|
||||||
this.dataSourceServiceFactory = dataSourceServiceFactory;
|
this.dataSourceServiceFactory = dataSourceServiceFactory;
|
||||||
this.savingsAccountWritePlatformService = savingsAccountWritePlatformService;
|
this.savingsAccountWritePlatformService = savingsAccountWritePlatformService;
|
||||||
this.savingsAccountChargeReadPlatformService = savingsAccountChargeReadPlatformService;
|
this.savingsAccountChargeReadPlatformService = savingsAccountChargeReadPlatformService;
|
||||||
@@ -105,6 +103,7 @@ public class ScheduledJobRunnerServiceImpl implements ScheduledJobRunnerService
|
|||||||
this.trialBalanceRepositoryWrapper = trialBalanceRepositoryWrapper;
|
this.trialBalanceRepositoryWrapper = trialBalanceRepositoryWrapper;
|
||||||
this.jobRegisterService = jobRegisterService;
|
this.jobRegisterService = jobRegisterService;
|
||||||
this.scheduledJobDetailsRepository = scheduledJobDetailsRepository;
|
this.scheduledJobDetailsRepository = scheduledJobDetailsRepository;
|
||||||
|
this.fineractProperties = fineractProperties;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@@ -500,7 +499,7 @@ public class ScheduledJobRunnerServiceImpl implements ScheduledJobRunnerService
|
|||||||
List<ScheduledJobDetail> jobDetails = this.scheduledJobDetailsRepository.findAllMismatchedJobs(true);
|
List<ScheduledJobDetail> jobDetails = this.scheduledJobDetailsRepository.findAllMismatchedJobs(true);
|
||||||
|
|
||||||
for (ScheduledJobDetail scheduledJobDetail : jobDetails) {
|
for (ScheduledJobDetail scheduledJobDetail : jobDetails) {
|
||||||
if (scheduledJobDetail.getNodeId().toString().equals(this.nodeId)) {
|
if (scheduledJobDetail.getNodeId().toString().equals(fineractProperties.getNodeId())) {
|
||||||
jobRegisterService.executeJob(scheduledJobDetail.getId());
|
jobRegisterService.executeJob(scheduledJobDetail.getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,27 +0,0 @@
|
|||||||
#
|
|
||||||
# Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
# or more contributor license agreements. See the NOTICE file
|
|
||||||
# distributed with this work for additional information
|
|
||||||
# regarding copyright ownership. The ASF licenses this file
|
|
||||||
# to you under the Apache License, Version 2.0 (the
|
|
||||||
# "License"); you may not use this file except in compliance
|
|
||||||
# with the License. You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing,
|
|
||||||
# software distributed under the License is distributed on an
|
|
||||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
# KIND, either express or implied. See the License for the
|
|
||||||
# specific language governing permissions and limitations
|
|
||||||
# under the License.
|
|
||||||
#
|
|
||||||
|
|
||||||
DRIVERCLASS_NAME:org.mariadb.jdbc.Driver
|
|
||||||
PROTOCOL:jdbc
|
|
||||||
SUB_PROTOCOL:mariadb
|
|
||||||
|
|
||||||
fineract_tenants_driver:org.mariadb.jdbc.Driver
|
|
||||||
fineract_tenants_url:jdbc:mariadb://localhost:3306/fineract_tenants
|
|
||||||
fineract_tenants_uid:root
|
|
||||||
fineract_tenants_pwd:mysql
|
|
||||||
@@ -17,10 +17,22 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
fineract.node-id=${FINERACT_NODE_ID:1}
|
||||||
|
|
||||||
fineract.security.basicauth.enabled=${FINERACT_SECURITY_BASICAUTH_ENABLED:true}
|
fineract.security.basicauth.enabled=${FINERACT_SECURITY_BASICAUTH_ENABLED:true}
|
||||||
fineract.security.oauth.enabled=${FINERACT_SECURITY_OAUTH_ENABLED:false}
|
fineract.security.oauth.enabled=${FINERACT_SECURITY_OAUTH_ENABLED:false}
|
||||||
fineract.security.2fa.enabled=${FINERACT_SECURITY_2FA_ENABLED:false}
|
fineract.security.2fa.enabled=${FINERACT_SECURITY_2FA_ENABLED:false}
|
||||||
|
|
||||||
|
fineract.tenant.host=${FINERACT_DEFAULT_TENANTDB_HOSTNAME:localhost}
|
||||||
|
fineract.tenant.port=${FINERACT_DEFAULT_TENANTDB_PORT:3306}
|
||||||
|
fineract.tenant.username=${FINERACT_DEFAULT_TENANTDB_UID:root}
|
||||||
|
fineract.tenant.password=${FINERACT_DEFAULT_TENANTDB_PWD:mysql}
|
||||||
|
fineract.tenant.parameters=${FINERACT_DEFAULT_TENANTDB_CONN_PARAMS:}
|
||||||
|
fineract.tenant.timezone=${FINERACT_DEFAULT_TENANTDB_TIMEZONE:Asia/Kolkata}
|
||||||
|
fineract.tenant.identifier=${FINERACT_DEFAULT_TENANTDB_IDENTIFIER:default}
|
||||||
|
fineract.tenant.name=${FINERACT_DEFAULT_TENANTDB_NAME:fineract_default}
|
||||||
|
fineract.tenant.description=${FINERACT_DEFAULT_TENANTDB_DESCRIPTION:Default Demo Tenant}
|
||||||
|
|
||||||
management.health.jms.enabled=false
|
management.health.jms.enabled=false
|
||||||
|
|
||||||
# FINERACT 1296
|
# FINERACT 1296
|
||||||
@@ -37,3 +49,28 @@ server.forward-headers-strategy=framework
|
|||||||
|
|
||||||
# OAuth authorisation server endpoint
|
# OAuth authorisation server endpoint
|
||||||
spring.security.oauth2.resourceserver.jwt.issuer-uri=http://localhost:9000/auth/realms/fineract
|
spring.security.oauth2.resourceserver.jwt.issuer-uri=http://localhost:9000/auth/realms/fineract
|
||||||
|
|
||||||
|
spring.datasource.hikari.driverClassName=${FINERACT_HIKARI_DRIVER_SOURCE_CLASS_NAME:org.mariadb.jdbc.Driver}
|
||||||
|
spring.datasource.hikari.jdbcUrl=${FINERACT_HIKARI_JDBC_URL:'jdbc:mariadb://localhost:3306/fineract_tenants'}
|
||||||
|
spring.datasource.hikari.username=${FINERACT_HIKARI_USERNAME:root}
|
||||||
|
spring.datasource.hikari.password=${FINERACT_HIKARI_PASSWORD:mysql}
|
||||||
|
spring.datasource.hikari.minimumIdle=${FINERACT_HIKARI_MINIMUM_IDLE:3}
|
||||||
|
spring.datasource.hikari.maximumPoolSize=${FINERACT_HIKARI_MAXIMUM_POOL_SIZE:10}
|
||||||
|
spring.datasource.hikari.idleTimeout=${FINERACT_HIKARI_IDLE_TIMEOUT:60000}
|
||||||
|
spring.datasource.hikari.connectionTimeout=${FINERACT_HIKARI_CONNECTION_TIMEOUT:20000}
|
||||||
|
spring.datasource.hikari.connectionTestquery=${FINERACT_HIKARI_TEST_QUERY:SELECT 1}
|
||||||
|
spring.datasource.hikari.autoCommit=${FINERACT_HIKARI_AUTO_COMMIT:true}
|
||||||
|
spring.datasource.hikari.dataSourceProperties['cachePrepStmts']=${FINERACT_HIKARI_DS_PROPERTIES_CACHE_PREP_STMTS:true}
|
||||||
|
spring.datasource.hikari.dataSourceProperties['prepStmtCacheSize']=${FINERACT_HIKARI_DS_PROPERTIES_PREP_STMT_CACHE_SIZE:250}
|
||||||
|
spring.datasource.hikari.dataSourceProperties['prepStmtCacheSqlLimit']=${FINERACT_HIKARI_DS_PROPERTIES_PREP_STMT_CACHE_SQL_LIMIT:2048}
|
||||||
|
spring.datasource.hikari.dataSourceProperties['useServerPrepStmts']=${FINERACT_HIKARI_DS_PROPERTIES_USE_SERVER_PREP_STMTS:true}
|
||||||
|
spring.datasource.hikari.dataSourceProperties['useLocalSessionState']=${FINERACT_HIKARI_DS_PROPERTIES_USE_LOCAL_SESSION_STATE:true}
|
||||||
|
spring.datasource.hikari.dataSourceProperties['rewriteBatchedStatements']=${FINERACT_HIKARI_DS_PROPERTIES_REWRITE_BATCHED_STATEMENTS:true}
|
||||||
|
spring.datasource.hikari.dataSourceProperties['cacheResultSetMetadata']=${FINERACT_HIKARI_DS_PROPERTIES_CACHE_RESULT_SET_METADATA:true}
|
||||||
|
spring.datasource.hikari.dataSourceProperties['cacheServerConfiguration']=${FINERACT_HIKARI_DS_PROPERTIES_CACHE_SERVER_CONFIGURATION:true}
|
||||||
|
spring.datasource.hikari.dataSourceProperties['elideSetAutoCommits']=${FINERACT_HIKARI_DS_PROPERTIES_ELIDE_SET_AUTO_COMMITS:true}
|
||||||
|
spring.datasource.hikari.dataSourceProperties['maintainTimeStats']=${FINERACT_HIKARI_DS_PROPERTIES_MAINTAIN_TIME_STATS:false}
|
||||||
|
# https://github.com/brettwooldridge/HikariCP/wiki/JDBC-Logging#mysql-connectorj
|
||||||
|
# TODO FINERACT-890: <prop key="logger">com.mysql.cj.log.Slf4JLogger</prop>
|
||||||
|
spring.datasource.hikari.dataSourceProperties['logSlowQueries']=${FINERACT_HIKARI_DS_PROPERTIES_LOG_SLOW_QUERIES:true}
|
||||||
|
spring.datasource.hikari.dataSourceProperties['dumpQueriesOnException']=${FINERACT_HIKARI_DS_PROPERTIES_DUMP_QUERIES_IN_EXCEPTION:true}
|
||||||
|
|||||||
+1
-1
@@ -66,7 +66,7 @@ CREATE TABLE `tenants` (
|
|||||||
|
|
||||||
LOCK TABLES `tenants` WRITE;
|
LOCK TABLES `tenants` WRITE;
|
||||||
/*!40000 ALTER TABLE `tenants` DISABLE KEYS */;
|
/*!40000 ALTER TABLE `tenants` DISABLE KEYS */;
|
||||||
INSERT INTO `tenants` VALUES (1,'default','Default Demo Tenant','fineract_default','Asia/Kolkata',NULL,NULL,NULL,NULL,'${fineract_default_tenantdb_hostname}','${fineract_default_tenantdb_port}','${fineract_default_tenantdb_uid}','${fineract_default_tenantdb_pwd}',1);
|
INSERT INTO `tenants` VALUES (1,'${fineract.tenant.identifier}','${fineract.tenant.description}','${fineract.tenant.name}','${fineract.tenant.timezone}',NULL,NULL,NULL,NULL,'${fineract.tenant.host}','${fineract.tenant.port}','${fineract.tenant.username}','${fineract.tenant.password}',1);
|
||||||
-- Add tenants to support interoperation multi-tenancy
|
-- Add tenants to support interoperation multi-tenancy
|
||||||
-- INSERT INTO `tenants` VALUES (2,'tn01','Buffalo','tn01','Africa/Bujumbura',NULL,NULL,NULL,NULL,'localhost','3306','root','mysql',1);
|
-- INSERT INTO `tenants` VALUES (2,'tn01','Buffalo','tn01','Africa/Bujumbura',NULL,NULL,NULL,NULL,'localhost','3306','root','mysql',1);
|
||||||
-- INSERT INTO `tenants` VALUES (3,'tn02','Lion','tn02','Africa/Bujumbura',NULL,NULL,NULL,NULL,'localhost','3306','root','mysql',1);
|
-- INSERT INTO `tenants` VALUES (3,'tn02','Lion','tn02','Africa/Bujumbura',NULL,NULL,NULL,NULL,'localhost','3306','root','mysql',1);
|
||||||
|
|||||||
+1
-1
@@ -20,5 +20,5 @@
|
|||||||
ALTER TABLE `tenant_server_connections`
|
ALTER TABLE `tenant_server_connections`
|
||||||
ADD COLUMN `schema_connection_parameters` TEXT NULL DEFAULT NULL;
|
ADD COLUMN `schema_connection_parameters` TEXT NULL DEFAULT NULL;
|
||||||
UPDATE `tenant_server_connections`
|
UPDATE `tenant_server_connections`
|
||||||
SET `schema_connection_parameters`='${fineract_default_tenantdb_conn_params}'
|
SET `schema_connection_parameters`='${fineract.tenant.parameters}'
|
||||||
WHERE `id`=1;
|
WHERE `id`=1;
|
||||||
|
|||||||
+4
-1
@@ -20,9 +20,11 @@ package org.apache.fineract.infrastructure.configuration.spring;
|
|||||||
|
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
import org.apache.fineract.infrastructure.core.boot.AbstractApplicationConfiguration;
|
import org.apache.fineract.infrastructure.core.boot.AbstractApplicationConfiguration;
|
||||||
|
import org.apache.fineract.infrastructure.core.config.FineractProperties;
|
||||||
import org.apache.fineract.infrastructure.core.service.TenantDatabaseUpgradeService;
|
import org.apache.fineract.infrastructure.core.service.TenantDatabaseUpgradeService;
|
||||||
import org.apache.fineract.infrastructure.jobs.service.JobRegisterService;
|
import org.apache.fineract.infrastructure.jobs.service.JobRegisterService;
|
||||||
import org.mockito.Mockito;
|
import org.mockito.Mockito;
|
||||||
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Primary;
|
import org.springframework.context.annotation.Primary;
|
||||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||||
@@ -33,6 +35,7 @@ import org.springframework.security.crypto.password.PasswordEncoder;
|
|||||||
* are in the DB), thus nor starts any background jobs. For some integration tests, this may be perfectly sufficient
|
* are in the DB), thus nor starts any background jobs. For some integration tests, this may be perfectly sufficient
|
||||||
* (and faster to run such tests).
|
* (and faster to run such tests).
|
||||||
*/
|
*/
|
||||||
|
@EnableConfigurationProperties({ FineractProperties.class })
|
||||||
public class TestsWithoutDatabaseAndNoJobsConfiguration extends AbstractApplicationConfiguration {
|
public class TestsWithoutDatabaseAndNoJobsConfiguration extends AbstractApplicationConfiguration {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -41,7 +44,7 @@ public class TestsWithoutDatabaseAndNoJobsConfiguration extends AbstractApplicat
|
|||||||
*/
|
*/
|
||||||
@Bean
|
@Bean
|
||||||
public TenantDatabaseUpgradeService tenantDatabaseUpgradeService() {
|
public TenantDatabaseUpgradeService tenantDatabaseUpgradeService() {
|
||||||
return new TenantDatabaseUpgradeService(null, null) {
|
return new TenantDatabaseUpgradeService(null, null, null, null) {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void upgradeAllTenants() {
|
public void upgradeAllTenants() {
|
||||||
|
|||||||
@@ -17,10 +17,22 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
fineract.node-id=1
|
||||||
|
|
||||||
fineract.security.basicauth.enabled=true
|
fineract.security.basicauth.enabled=true
|
||||||
fineract.security.oauth.enabled=false
|
fineract.security.oauth.enabled=false
|
||||||
fineract.security.2fa.enabled=false
|
fineract.security.2fa.enabled=false
|
||||||
|
|
||||||
|
fineract.tenant.host=localhost
|
||||||
|
fineract.tenant.port=3306
|
||||||
|
fineract.tenant.username=root
|
||||||
|
fineract.tenant.password=mysql
|
||||||
|
fineract.tenant.parameters=
|
||||||
|
fineract.tenant.timezone=Asia/Kolkata
|
||||||
|
fineract.tenant.identifier=default
|
||||||
|
fineract.tenant.name=fineract_default
|
||||||
|
fineract.tenant.description=Default Demo Tenant
|
||||||
|
|
||||||
management.health.jms.enabled=false
|
management.health.jms.enabled=false
|
||||||
|
|
||||||
# FINERACT 1296
|
# FINERACT 1296
|
||||||
@@ -34,3 +46,26 @@ management.endpoints.web.exposure.include=health,info
|
|||||||
|
|
||||||
# FINERACT-914
|
# FINERACT-914
|
||||||
server.forward-headers-strategy=framework
|
server.forward-headers-strategy=framework
|
||||||
|
|
||||||
|
spring.datasource.hikari.driverClassName=org.mariadb.jdbc.Driver
|
||||||
|
spring.datasource.hikari.jdbcUrl=jdbc:mariadb://localhost:3306/fineract_tenants
|
||||||
|
spring.datasource.hikari.username=root
|
||||||
|
spring.datasource.hikari.password=mysql
|
||||||
|
spring.datasource.hikari.minimumIdle=3
|
||||||
|
spring.datasource.hikari.maximumPoolSize=10
|
||||||
|
spring.datasource.hikari.idleTimeout=60000
|
||||||
|
spring.datasource.hikari.connectionTimeout=20000
|
||||||
|
spring.datasource.hikari.connectionTestQuery=SELECT 1
|
||||||
|
spring.datasource.hikari.autoCommit=true
|
||||||
|
spring.datasource.hikari.dataSourceProperties['cachePrepStmts']=true
|
||||||
|
spring.datasource.hikari.dataSourceProperties['prepStmtCacheSize']=250
|
||||||
|
spring.datasource.hikari.dataSourceProperties['prepStmtCacheSqlLimit']=2048
|
||||||
|
spring.datasource.hikari.dataSourceProperties['useServerPrepStmts']=true
|
||||||
|
spring.datasource.hikari.dataSourceProperties['useLocalSessionState']=true
|
||||||
|
spring.datasource.hikari.dataSourceProperties['rewriteBatchedStatements']=true
|
||||||
|
spring.datasource.hikari.dataSourceProperties['cacheResultSetMetadata']=true
|
||||||
|
spring.datasource.hikari.dataSourceProperties['cacheServerConfiguration']=true
|
||||||
|
spring.datasource.hikari.dataSourceProperties['elideSetAutoCommits']=true
|
||||||
|
spring.datasource.hikari.dataSourceProperties['maintainTimeStats']=false
|
||||||
|
spring.datasource.hikari.dataSourceProperties['logSlowQueries']=true
|
||||||
|
spring.datasource.hikari.dataSourceProperties['dumpQueriesOnException']=true
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ cargo {
|
|||||||
}
|
}
|
||||||
startStopTimeout = 240000
|
startStopTimeout = 240000
|
||||||
containerProperties {
|
containerProperties {
|
||||||
property 'cargo.start.jvmargs', '--add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-opens=java.naming/javax.naming=ALL-UNNAMED'
|
property 'cargo.start.jvmargs', '--add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-opens=java.naming/javax.naming=ALL-UNNAMED -Dspring.datasource.hikari.driverClassName=org.mariadb.jdbc.Driver -Dspring.datasource.hikari.jdbcUrl=jdbc:mariadb://localhost:3306/fineract_tenants -Dspring.datasource.hikari.username=root -Dspring.datasource.hikari.password=mysql -Dfineract.tenant.host=localhost -Dfineract.tenant.port=3306 -Dfineract.tenant.username=root -Dfineract.tenant.password=mysql'
|
||||||
property 'cargo.tomcat.connector.keystoreFile', file("$rootDir/fineract-provider/src/main/resources/keystore.jks")
|
property 'cargo.tomcat.connector.keystoreFile', file("$rootDir/fineract-provider/src/main/resources/keystore.jks")
|
||||||
property 'cargo.tomcat.connector.keystorePass', 'openmf'
|
property 'cargo.tomcat.connector.keystorePass', 'openmf'
|
||||||
property 'cargo.tomcat.httpSecure', true
|
property 'cargo.tomcat.httpSecure', true
|
||||||
|
|||||||
@@ -81,24 +81,18 @@ spec:
|
|||||||
initialDelaySeconds: 180
|
initialDelaySeconds: 180
|
||||||
periodSeconds: 1
|
periodSeconds: 1
|
||||||
env:
|
env:
|
||||||
- name: DRIVERCLASS_NAME
|
- name: FINERACT_NODE_ID
|
||||||
value: org.mariadb.jdbc.Driver
|
|
||||||
- name: PROTOCOL
|
|
||||||
value: jdbc
|
|
||||||
- name: SUB_PROTOCOL
|
|
||||||
value: mariadb
|
|
||||||
- name: node_id
|
|
||||||
value: '1'
|
value: '1'
|
||||||
- name: fineract_tenants_driver
|
- name: FINERACT_HIKARI_DRIVER_CLASS_NAME
|
||||||
value: org.mariadb.jdbc.Driver
|
value: org.mariadb.jdbc.Driver
|
||||||
- name: fineract_tenants_url
|
- name: FINERACT_HIKARI_JDBC_URL
|
||||||
value: jdbc:mariadb://fineractmysql:3306/fineract_tenants
|
value: jdbc:mariadb://fineractmysql:3306/fineract_tenants
|
||||||
- name: fineract_tenants_uid
|
- name: FINERACT_HIKARI_USERNAME
|
||||||
valueFrom:
|
valueFrom:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: fineract-tenants-db-secret
|
name: fineract-tenants-db-secret
|
||||||
key: username
|
key: username
|
||||||
- name: fineract_tenants_pwd
|
- name: FINERACT_HIKARI_PASSWORD
|
||||||
valueFrom:
|
valueFrom:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: fineract-tenants-db-secret
|
name: fineract-tenants-db-secret
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ cargo {
|
|||||||
}
|
}
|
||||||
startStopTimeout = 240000
|
startStopTimeout = 240000
|
||||||
containerProperties {
|
containerProperties {
|
||||||
property 'cargo.start.jvmargs', '-Dfineract.security.basicauth.enabled=false -Dfineract.security.oauth.enabled=true -Dfineract.security.2fa.enabled=false --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-opens=java.naming/javax.naming=ALL-UNNAMED'
|
property 'cargo.start.jvmargs', '-Dfineract.security.basicauth.enabled=false -Dfineract.security.oauth.enabled=true -Dfineract.security.2fa.enabled=false -Dspring.datasource.hikari.driverClassName=org.mariadb.jdbc.Driver -Dspring.datasource.hikari.jdbcUrl=jdbc:mariadb://localhost:3306/fineract_tenants -Dspring.datasource.hikari.username=root -Dspring.datasource.hikari.password=mysql -Dfineract.tenant.host=localhost -Dfineract.tenant.port=3306 -Dfineract.tenant.username=root -Dfineract.tenant.password=mysql --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-opens=java.naming/javax.naming=ALL-UNNAMED'
|
||||||
property 'cargo.tomcat.connector.keystoreFile', file("$rootDir/fineract-provider/src/main/resources/keystore.jks")
|
property 'cargo.tomcat.connector.keystoreFile', file("$rootDir/fineract-provider/src/main/resources/keystore.jks")
|
||||||
property 'cargo.tomcat.connector.keystorePass', 'openmf'
|
property 'cargo.tomcat.connector.keystorePass', 'openmf'
|
||||||
property 'cargo.tomcat.httpSecure', true
|
property 'cargo.tomcat.httpSecure', true
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ cargo {
|
|||||||
}
|
}
|
||||||
startStopTimeout = 240000
|
startStopTimeout = 240000
|
||||||
containerProperties {
|
containerProperties {
|
||||||
property 'cargo.start.jvmargs', '-Dfineract.security.basicauth.enabled=true -Dfineract.security.oauth.enabled=false -Dfineract.security.2fa.enabled=true --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-opens=java.naming/javax.naming=ALL-UNNAMED'
|
property 'cargo.start.jvmargs', '-Dfineract.security.basicauth.enabled=true -Dfineract.security.oauth.enabled=false -Dfineract.security.2fa.enabled=true -Dspring.datasource.hikari.driverClassName=org.mariadb.jdbc.Driver -Dspring.datasource.hikari.jdbcUrl=jdbc:mariadb://localhost:3306/fineract_tenants -Dspring.datasource.hikari.username=root -Dspring.datasource.hikari.password=mysql -Dfineract.tenant.host=localhost -Dfineract.tenant.port=3306 -Dfineract.tenant.username=root -Dfineract.tenant.password=mysql --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-opens=java.naming/javax.naming=ALL-UNNAMED'
|
||||||
property 'cargo.tomcat.connector.keystoreFile', file("$rootDir/fineract-provider/src/main/resources/keystore.jks")
|
property 'cargo.tomcat.connector.keystoreFile', file("$rootDir/fineract-provider/src/main/resources/keystore.jks")
|
||||||
property 'cargo.tomcat.connector.keystorePass', 'openmf'
|
property 'cargo.tomcat.connector.keystorePass', 'openmf'
|
||||||
property 'cargo.tomcat.httpSecure', true
|
property 'cargo.tomcat.httpSecure', true
|
||||||
|
|||||||
Reference in New Issue
Block a user