diff options
author | Stanislav Marszalek <s.marszalek2@partner.samsung.com> | 2021-08-24 10:23:05 +0200 |
---|---|---|
committer | Stanislav Marszalek <s.marszalek2@partner.samsung.com> | 2021-08-24 10:23:05 +0200 |
commit | 1824fca74c48836cfd073f7a12eb169e4f65ac3f (patch) | |
tree | 3b1e1cfd5241a41f9757dd8fc367d3917c4ecf56 | |
parent | 1853d7375ee7d5b255fd929fc6790385112ba346 (diff) |
Datacollector performance issue in ONAP deployment
Issue-ID: INT-1959
Signed-off-by: Stanislav Marszalek <s.marszalek2@partner.samsung.com>
Change-Id: I02d3684c98d563d7f386de2fdf032e930ac76b1f
-rw-r--r-- | datacollector/pom.xml | 5 | ||||
-rw-r--r-- | datacollector/src/main/java/org/onap/rapp/datacollector/service/configuration/DmaapRestReaderConfiguration.java | 5 | ||||
-rw-r--r-- | pom.xml | 1 |
3 files changed, 9 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()); @@ -59,6 +59,7 @@ <gson.version>2.8.6</gson.version> <javax.xml.bind.version>2.3.0</javax.xml.bind.version> <swagger.version>2.9.2</swagger.version> + <dbcp.version>1.2.2</dbcp.version> <swagger.maven.plugin.version>3.1.7</swagger.maven.plugin.version> </properties> |