summaryrefslogtreecommitdiffstats
path: root/datacollector
diff options
context:
space:
mode:
authorStanislav Marszalek <s.marszalek2@partner.samsung.com>2021-08-24 10:23:05 +0200
committerStanislav Marszalek <s.marszalek2@partner.samsung.com>2021-08-24 10:23:05 +0200
commit1824fca74c48836cfd073f7a12eb169e4f65ac3f (patch)
tree3b1e1cfd5241a41f9757dd8fc367d3917c4ecf56 /datacollector
parent1853d7375ee7d5b255fd929fc6790385112ba346 (diff)
Datacollector performance issue in ONAP deployment
Issue-ID: INT-1959 Signed-off-by: Stanislav Marszalek <s.marszalek2@partner.samsung.com> Change-Id: I02d3684c98d563d7f386de2fdf032e930ac76b1f
Diffstat (limited to 'datacollector')
-rw-r--r--datacollector/pom.xml5
-rw-r--r--datacollector/src/main/java/org/onap/rapp/datacollector/service/configuration/DmaapRestReaderConfiguration.java5
2 files changed, 8 insertions, 2 deletions
diff --git a/datacollector/pom.xml b/datacollector/pom.xml
index db59334..0c2467c 100644
--- a/datacollector/pom.xml
+++ b/datacollector/pom.xml
@@ -81,6 +81,11 @@
<artifactId>jaxb-api</artifactId>
<version>${javax.xml.bind.version}</version>
</dependency>
+ <dependency>
+ <groupId>commons-dbcp</groupId>
+ <artifactId>commons-dbcp</artifactId>
+ <version>${dbcp.version}</version>
+ </dependency>
</dependencies>
<build>
diff --git a/datacollector/src/main/java/org/onap/rapp/datacollector/service/configuration/DmaapRestReaderConfiguration.java b/datacollector/src/main/java/org/onap/rapp/datacollector/service/configuration/DmaapRestReaderConfiguration.java
index 9752fb5..ab1bd0a 100644
--- a/datacollector/src/main/java/org/onap/rapp/datacollector/service/configuration/DmaapRestReaderConfiguration.java
+++ b/datacollector/src/main/java/org/onap/rapp/datacollector/service/configuration/DmaapRestReaderConfiguration.java
@@ -30,6 +30,8 @@ import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import javax.sql.DataSource;
+
+import org.apache.commons.dbcp.BasicDataSource;
import org.apache.http.client.HttpClient;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.conn.ssl.TrustAllStrategy;
@@ -40,7 +42,6 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
-import org.springframework.jdbc.datasource.DriverManagerDataSource;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.web.client.RestTemplate;
@@ -128,7 +129,7 @@ public class DmaapRestReaderConfiguration {
@Bean
public DataSource dataSource() {
- DriverManagerDataSource dataSource = new DriverManagerDataSource();
+ BasicDataSource dataSource = new BasicDataSource();
dataSource.setDriverClassName(databaseProperties.getDriverClassName());
dataSource.setUrl("jdbc:mysql://" + databaseProperties.getHost() + ":" + databaseProperties.getPort() + "/" + databaseProperties.getName());
dataSource.setUsername(databaseProperties.getUsername());