using spring-boot-starter-data-jpa version 2.2.4. release spring-cloud-dependencies Greenwhich.SR1 Enabled below properties in application.properties
spring.datasource.hikari.maximum-pool-size=30
spring.datasource.hikari.connection-timeout=60000
spring.datasource.hikari.leak-detection-threshold=20000
On starting the server getting below hikari configuration
DEBUG|com.zaxxer.hikari.HikariConfig|Driver class org.postgresql.Driver found in Thread context class loader TomcatEmbeddedWebappClassLoader
delegate: true
2020-04-14T01:37:02.27+0530 [APP/PROC/WEB/0] OUT org.springframework.boot.loader.LaunchedURLClassLoader@6973bf95
|DEBUG|com.zaxxer.hikari.HikariConfig|allowPoolSuspension.............false
|DEBUG|com.zaxxer.hikari.HikariConfig|autoCommit......................true
|DEBUG|com.zaxxer.hikari.HikariConfig|catalog.........................none
|DEBUG|com.zaxxer.hikari.HikariConfig|connectionInitSql...............none
|DEBUG|com.zaxxer.hikari.HikariConfig|connectionTestQuery............."SELECT 1"
|DEBUG|com.zaxxer.hikari.HikariConfig|connectionTimeout...............30000
|DEBUG|com.zaxxer.hikari.HikariConfig|dataSource......................none
|DEBUG|com.zaxxer.hikari.HikariConfig|dataSourceClassName.............none
com.zaxxer.hikari.HikariConfig|dataSourceJNDI..................none
|DEBUG|com.zaxxer.hikari.HikariConfig|dataSourceProperties............{password=<masked>}
|DEBUG|com.zaxxer.hikari.HikariConfig|driverClassName................."org.postgresql.Driver"
|DEBUG|com.zaxxer.hikari.HikariConfig|healthCheckProperties...........{}
|DEBUG|com.zaxxer.hikari.HikariConfig|healthCheckRegistry.............none
|com.zaxxer.hikari.HikariConfig|idleTimeout.....................600000
DEBUG|com.zaxxer.hikari.HikariConfig|initializationFailTimeout.......1
DEBUG|com.zaxxer.hikari.HikariConfig|isolateInternalQueries..........false
|DEBUG|com.zaxxer.hikari.HikariConfig|leakDetectionThreshold..........0
|com.zaxxer.hikari.HikariConfig|maxLifetime.....................1800000
|com.zaxxer.hikari.HikariConfig|maximumPoolSize.................4
|DEBUG|com.zaxxer.hikari.HikariConfig|metricRegistry..................none
|DEBUG|com.zaxxer.hikari.HikariConfig|metricsTrackerFactory...........none
|DEBUG|com.zaxxer.hikari.HikariConfig|minimumIdle.....................0
|DEBUG|com.zaxxer.hikari.HikariConfig|password........................<masked>
|DEBUG|com.zaxxer.hikari.HikariConfig|poolName........................"HikariPool-1"
|DEBUG|com.zaxxer.hikari.HikariConfig|readOnly........................false
|DEBUG|com.zaxxer.hikari.HikariConfig|registerMbeans..................false
|DEBUG|com.zaxxer.hikari.HikariConfig|scheduledExecutor...............none
|DEBUG|com.zaxxer.hikari.HikariConfig|schema..........................none
|DEBUG|com.zaxxer.hikari.HikariConfig|threadFactory...................internal
|DEBUG|com.zaxxer.hikari.HikariConfig|transactionIsolation............default
|DEBUG|com.zaxxer.hikari.HikariConfig|username........................none
|DEBUG|com.zaxxer.hikari.HikariConfig|validationTimeout...............5000
INFO|com.zaxxer.hikari.HikariDataSource|HikariPool-1 - Starting...
DataSource configured
CloudFactory().getCloud().getSingletonServiceConnector(DataSource.class, null);
Can somebody please suggest what am i missing
Comment From: scottfrederick
DataSource configured CloudFactory().getCloud().getSingletonServiceConnector(DataSource.class, null);
This indicates that you are using Spring Cloud Connectors to create and configure a java.sql.DataSource
bean based on a service bound to your app in Cloud Foundry. When Connectors configures the DataSource
bean, Spring Boot auto-configuration backs off because it detects that a DataSource
bean already exists. Since Boot auto-configuration backs off, the spring.datasource.hikari.*
properties are ignored.
If you want to continue using Connectors to configure the DataSource
bean, you will need to use the Connectors API to configure the connection pool size and other properties of the connection.
However, Spring Cloud Connectors is in maintenance mode, and its use is discouraged in favor of the Java CFEnv library. This inability for Connectors and Boot to work together is one of the reasons that the use of Connectors is discouraged. Java CFEnv is Boot-aware, and allows connection properties to be configured using Boot properties as you are attempting to do.
If you have more questions please follow up on StackOverflow, as mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements.