BAEL-951 Self-Healing Services with Spring Cloud - C3
This commit is contained in:
parent
0021df4637
commit
fb4ba02ecf
@ -1,24 +0,0 @@
|
||||
package com.baeldung.spring.cloud.bootstrap.svcrating;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
|
||||
|
||||
public class CacheConfig {
|
||||
|
||||
@Autowired
|
||||
CacheProperties cacheProperties;
|
||||
|
||||
@Bean(name="cacheConnectionFactory")
|
||||
@Qualifier("cacheJedisConnectionFactory")
|
||||
JedisConnectionFactory cacheConnectionFactory() {
|
||||
JedisConnectionFactory factory = new JedisConnectionFactory();
|
||||
factory.setHostName(cacheProperties.hostName);
|
||||
factory.setPort(cacheProperties.port);
|
||||
factory.setUsePool(true);
|
||||
factory.afterPropertiesSet();
|
||||
return factory;
|
||||
}
|
||||
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
package com.baeldung.spring.cloud.bootstrap.svcrating;
|
||||
|
||||
public class CacheProperties {
|
||||
public String hostName;
|
||||
public int port;
|
||||
|
||||
public String getHostName() {
|
||||
return hostName;
|
||||
}
|
||||
public void setHostName(String hostName) {
|
||||
this.hostName = hostName;
|
||||
}
|
||||
public int getPort() {
|
||||
return port;
|
||||
}
|
||||
public void setPort(int port) {
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user