You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ni...@apache.org on 2020/10/30 16:57:47 UTC
[activemq-artemis] branch master updated (10debc3 -> 8bf8bba)
This is an automated email from the ASF dual-hosted git repository.
nigrofranz pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git.
from 10debc3 NO-JIRA bump on extra-tests
new b39c9c9 ARTEMIS-2823 Apply default datasource configs if not overridden
new e4a2a20 ARTEMIS-2941 Fixing query timeout value
new 8bf8bba This closes #3324
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../storage/DatabaseStorageConfiguration.java | 35 +++++++++++++++-------
.../core/server/impl/jdbc/JdbcLeaseLock.java | 9 ++++--
2 files changed, 30 insertions(+), 14 deletions(-)
[activemq-artemis] 01/03: ARTEMIS-2823 Apply default datasource
configs if not overridden
Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
nigrofranz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git
commit b39c9c9221718cda4a0d3689c9e739e690ec5c5e
Author: franz1981 <ni...@gmail.com>
AuthorDate: Fri Oct 30 17:27:50 2020 +0100
ARTEMIS-2823 Apply default datasource configs if not overridden
---
.../storage/DatabaseStorageConfiguration.java | 35 +++++++++++++++-------
1 file changed, 24 insertions(+), 11 deletions(-)
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/storage/DatabaseStorageConfiguration.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/storage/DatabaseStorageConfiguration.java
index 8ea933e..ebd824d 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/storage/DatabaseStorageConfiguration.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/storage/DatabaseStorageConfiguration.java
@@ -152,19 +152,32 @@ public class DatabaseStorageConfiguration implements StoreConfiguration {
private DataSource getDataSource() {
if (dataSource == null) {
// the next settings are going to be applied only if the datasource is the default one
- if (dataSourceProperties.isEmpty() && ActiveMQDefaultConfiguration.getDefaultDataSourceClassName().equals(dataSourceClassName)) {
- addDataSourceProperty("driverClassName", jdbcDriverClassName);
- addDataSourceProperty("url", jdbcConnectionUrl);
- if (jdbcUser != null) {
- addDataSourceProperty("username", jdbcUser);
+ if (ActiveMQDefaultConfiguration.getDefaultDataSourceClassName().equals(dataSourceClassName)) {
+ // these default settings will be applied only if a custom configuration won't override them
+ if (!dataSourceProperties.containsKey("driverClassName")) {
+ addDataSourceProperty("driverClassName", jdbcDriverClassName);
}
- if (jdbcPassword != null) {
- addDataSourceProperty("password", jdbcPassword);
+ if (!dataSourceProperties.containsKey("url")) {
+ addDataSourceProperty("url", jdbcConnectionUrl);
+ }
+ if (!dataSourceProperties.containsKey("username")) {
+ if (jdbcUser != null) {
+ addDataSourceProperty("username", jdbcUser);
+ }
+ }
+ if (!dataSourceProperties.containsKey("password")) {
+ if (jdbcPassword != null) {
+ addDataSourceProperty("password", jdbcPassword);
+ }
+ }
+ if (!dataSourceProperties.containsKey("maxTotal")) {
+ // Let the pool to have unbounded number of connections by default to prevent connection starvation
+ addDataSourceProperty("maxTotal", "-1");
+ }
+ if (!dataSourceProperties.containsKey("poolPreparedStatements")) {
+ // Let the pool to have unbounded number of cached prepared statements to save the initialization cost
+ addDataSourceProperty("poolPreparedStatements", "true");
}
- // Let the pool to have unbounded number of connections by default to prevent connection starvation
- addDataSourceProperty("maxTotal", "-1");
- // Let the pool to have unbounded number of cached prepared statements to save the initialization cost
- addDataSourceProperty("poolPreparedStatements", "true");
}
dataSource = JDBCDataSourceUtils.getDataSource(dataSourceClassName, dataSourceProperties);
}
[activemq-artemis] 03/03: This closes #3324
Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
nigrofranz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git
commit 8bf8bbaf77a393d2e1ea985b826f30a1e1a391b5
Merge: 10debc3 e4a2a20
Author: franz1981 <ni...@gmail.com>
AuthorDate: Fri Oct 30 17:57:28 2020 +0100
This closes #3324
.../storage/DatabaseStorageConfiguration.java | 35 +++++++++++++++-------
.../core/server/impl/jdbc/JdbcLeaseLock.java | 9 ++++--
2 files changed, 30 insertions(+), 14 deletions(-)
[activemq-artemis] 02/03: ARTEMIS-2941 Fixing query timeout value
Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
nigrofranz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git
commit e4a2a20c228c5c46838494b5325274ff79ff0145
Author: franz1981 <ni...@gmail.com>
AuthorDate: Fri Oct 30 17:42:15 2020 +0100
ARTEMIS-2941 Fixing query timeout value
---
.../activemq/artemis/core/server/impl/jdbc/JdbcLeaseLock.java | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/jdbc/JdbcLeaseLock.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/jdbc/JdbcLeaseLock.java
index f1c789c..ba8c200 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/jdbc/JdbcLeaseLock.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/jdbc/JdbcLeaseLock.java
@@ -77,10 +77,13 @@ final class JdbcLeaseLock implements LeaseLock {
this.connectionProvider = connectionProvider;
this.lockName = lockName;
this.localExpirationTime = -1;
- int expectedTimeout = (int) (queryTimeoutMillis > 0 ? TimeUnit.MILLISECONDS.toSeconds(queryTimeoutMillis) : -1);
+ int expectedTimeout = -1;
if (queryTimeoutMillis >= 0) {
- LOGGER.warn("queryTimeoutMillis is too low: it's suggested to configure a multi-seconds value. Disabling it because too low.");
- expectedTimeout = -1;
+ expectedTimeout = (int) TimeUnit.MILLISECONDS.toSeconds(queryTimeoutMillis);
+ if (expectedTimeout <= 0) {
+ LOGGER.warn("queryTimeoutMillis is too low: it's suggested to configure a multi-seconds value. Disabling it because too low.");
+ expectedTimeout = -1;
+ }
}
this.queryTimeout = expectedTimeout;