Home > Back-end >  If SSM in the configuration file configuration redis configuration inside this, I want to get a spri
If SSM in the configuration file configuration redis configuration inside this, I want to get a spri

Time:03-04

 
& lt; Bean id="shardedJedisPool" & gt;
& lt; Constructor - arg index="0" ref="jedisPoolConfig"/& gt;
& lt; The constructor - arg index="1" & gt;
& lt; List>
& lt; The bean name="master" & gt;
& lt; Constructor - arg index="0" value="https://bbs.csdn.net/topics/${redis. Host}"/& gt;
& lt;/bean>
& lt;/list>
& lt;/constructor - arg>
& lt;/bean>
& lt; Bean id="jedisPoolConfig" & gt;
& lt; The property name="maxTotal" value="https://bbs.csdn.net/topics/1000"/& gt;
& lt; The property name="maxIdle" value="https://bbs.csdn.net/topics/100"/& gt;
& lt; The property name="numTestsPerEvictionRun" value="https://bbs.csdn.net/topics/1024"/& gt;
& lt; The property name="timeBetweenEvictionRunsMillis" value="https://bbs.csdn.net/topics/30000"/& gt;
& lt; The property name="minEvictableIdleTimeMillis" value="https://bbs.csdn.net/topics/-1"/& gt;
& lt; The property name="softMinEvictableIdleTimeMillis" value="https://bbs.csdn.net/topics/10000"/& gt;
& lt; The property name="maxWaitMillis" value="https://bbs.csdn.net/topics/5000"/& gt;
& lt; The property name="testOnBorrow" value="https://bbs.csdn.net/topics/true"/& gt;
& lt; The property name="testWhileIdle" value="https://bbs.csdn.net/topics/true"/& gt;
& lt; The property name="testOnReturn" value="https://bbs.csdn.net/topics/false"/& gt;
& lt; The property name="jmxEnabled" value="https://bbs.csdn.net/topics/true"/& gt;
& lt; The property name="jmxNamePrefix" value="https://bbs.csdn.net/topics/youyuan"/& gt;
& lt; The property name="blockWhenExhausted" value="https://bbs.csdn.net/topics/false"/& gt;
& lt;/bean>

CodePudding user response:

Yml file configuration, the configuration of the specific content online there are a lot of

CodePudding user response:

Mainly the don't know how to configure
& lt; Bean id="shardedJedisPool" & gt;
& lt; Constructor - arg index="0" ref="jedisPoolConfig"/& gt;
& lt; The constructor - arg index="1" & gt;
& lt; List>
& lt; The bean name="master" & gt;
& lt; Constructor - arg index="0" value="https://bbs.csdn.net/topics/${redis. Host}"/& gt;
& lt;/bean>
& lt;/list>
& lt;/constructor - arg>
& lt;/bean>

CodePudding user response:

reference is on the second floor into the wrong line response:
is mainly the don't know how to configure
& lt; Bean id="shardedJedisPool" & gt;
& lt; Constructor - arg index="0" ref="jedisPoolConfig"/& gt;
& lt; The constructor - arg index="1" & gt;
& lt; List>
& lt; The bean name="master" & gt;





Directly into the spring - the boot - starter - data - redis dependence, basic configuration here don't need, springboot has been configured for you

In general as long as the configuration springboot allocation of the following can be used in the configuration file
Spring. Redis. Host
Spring. Redis. "
Spring. Redis. Port
Spring. Redis. Pool. Max - active

CodePudding user response:

Springboot StringRedisTemplete is default redis interface

In the place where you need to use the automatic injection of the interface

The @autowired
Private StringRedisTemplate redisClient;
  • Related