diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle index d23641522..e31822f3c 100644 --- a/gradle/dependencies.gradle +++ b/gradle/dependencies.gradle @@ -28,7 +28,7 @@ def groovyVersion = '2.3.9' dependencies { compile ( - "com.nike:vault-client:1.0.0", + "com.nike:vault-client:1.4.0", "com.nike.riposte:riposte-spi:$riposteVersion", "com.nike.riposte:riposte-core:$riposteVersion", "com.nike.riposte:riposte-typesafe-config:$riposteVersion", diff --git a/src/main/java/com/nike/cerberus/server/config/guice/CmsGuiceModule.java b/src/main/java/com/nike/cerberus/server/config/guice/CmsGuiceModule.java index 08ad8a3e3..5dcb7bcd6 100644 --- a/src/main/java/com/nike/cerberus/server/config/guice/CmsGuiceModule.java +++ b/src/main/java/com/nike/cerberus/server/config/guice/CmsGuiceModule.java @@ -50,6 +50,7 @@ import com.nike.cerberus.util.UuidSupplier; import com.nike.cerberus.vault.CmsVaultCredentialsProvider; import com.nike.cerberus.vault.CmsVaultUrlResolver; +import com.nike.vault.client.ClientVersion; import com.nike.vault.client.UrlResolver; import com.nike.vault.client.VaultAdminClient; import com.nike.vault.client.VaultClientFactory; @@ -275,8 +276,11 @@ public UuidSupplier uuidSupplier() { */ @Singleton @Provides - public VaultAdminClient vaultAdminClient(UrlResolver urlResolver, VaultCredentialsProvider vaultCredentialsProvider) { - return VaultClientFactory.getAdminClient(urlResolver, vaultCredentialsProvider); + public VaultAdminClient vaultAdminClient(UrlResolver urlResolver, + VaultCredentialsProvider vaultCredentialsProvider, + @Named("vault.maxRequestsPerHost") int vaultMaxRequestsPerHost) { + logger.info("Vault clientVersion={}, maxRequestsPerHost={}, url={}", ClientVersion.getVersion(), vaultMaxRequestsPerHost, urlResolver.resolve()); + return VaultClientFactory.getAdminClient(urlResolver, vaultCredentialsProvider, vaultMaxRequestsPerHost); } @Provides diff --git a/src/main/resources/cms.conf b/src/main/resources/cms.conf index 2b1414fc7..f9d2b09c8 100644 --- a/src/main/resources/cms.conf +++ b/src/main/resources/cms.conf @@ -70,3 +70,5 @@ c3p0.idleConnectionTestPeriod=300 c3p0.maxIdleTimeExcessConnections=240 c3p0.preferredTestQuery=SELECT 1 +# Vault Admin client +vault.maxRequestsPerHost=200