com.aol.micro.server.spring.datasource.HikariCPConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of micro-hikaricp Show documentation
Show all versions of micro-hikaricp Show documentation
Opinionated rest microservices
package com.aol.micro.server.spring.datasource;
import lombok.Getter;
import lombok.Builder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@Getter
@Builder
@Component("hikariCPEnv")
public class HikariCPConfig {
private final int maxPoolSize;
private final int minimumIdle;
private final long idleTimeout;
@Autowired
public HikariCPConfig(@Value("${hikaricp.db.connection.max.pool.size:30}") int maxPoolSize, @Value("${hikaricp.db.connection.min.idle:2}") int minimumIdle,
@Value("${hikaricp.db.connection.idle.timeout:1800000}") long idleTimeout) {
this.maxPoolSize = maxPoolSize;
this.minimumIdle = minimumIdle;
this.idleTimeout = idleTimeout;
}
}