use of org.iplass.mtp.impl.redis.RedisService in project iPLAss by ISID.
the class RedisCacheStoreFactory method inited.
@Override
public void inited(CacheService service, Config config) {
RedisService rs = config.getDependentService(RedisService.class);
server = rs.getRedisServer(serverName);
if (server == null) {
throw new MtpException("Unknown redis server name: " + serverName);
}
ClientResources resouces = DefaultClientResources.builder().build();
RedisURI.Builder uriBuilder = RedisURI.builder().withHost(server.getHost()).withPort(server.getPort());
if (server.getTimeout() > 0) {
uriBuilder.withTimeout(Duration.ofSeconds(server.getTimeout()));
}
client = RedisClient.create(resouces, uriBuilder.build());
}
Aggregations