Skip to content
This repository has been archived by the owner on Jul 29, 2021. It is now read-only.

Commit

Permalink
feat(pool): set the max pool size
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasGeraud committed Apr 6, 2019
1 parent 33ec5ff commit 4c13dee
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 9 additions & 0 deletions pom.xml
Expand Up @@ -136,6 +136,15 @@
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<environmentVariables>
<management.redis.pool.max>512</management.redis.pool.max>
</environmentVariables>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
Expand Down
Expand Up @@ -48,8 +48,10 @@ public org.springframework.data.redis.connection.RedisConnectionFactory getObjec
jedisConnectionFactory.setPassword(readPropertyValue(propertyPrefix + "password", String.class, null));
jedisConnectionFactory.setTimeout(readPropertyValue(propertyPrefix + "timeout", int.class, -1));

int poolMax = readPropertyValue(propertyPrefix + "pool.max", int.class, 256);

JedisPoolConfig poolConfig = new JedisPoolConfig();
poolConfig.setMaxTotal(256);
poolConfig.setMaxTotal(poolMax);
poolConfig.setBlockWhenExhausted(false);
jedisConnectionFactory.setPoolConfig(poolConfig);

Expand Down

0 comments on commit 4c13dee

Please sign in to comment.