欧美一级特黄大片做受成人-亚洲成人一区二区电影-激情熟女一区二区三区-日韩专区欧美专区国产专区

springbootredis

dependency

成都創(chuàng)新互聯(lián)公司-專業(yè)網(wǎng)站定制、快速模板網(wǎng)站建設、高性價比博樂網(wǎng)站開發(fā)、企業(yè)建站全套包干低至880元,成熟完善的模板庫,直接使用。一站式博樂網(wǎng)站制作公司更省心,省錢,快速模板網(wǎng)站建設找我們,業(yè)務覆蓋博樂地區(qū)。費用合理售后完善,十余年實體公司更值得信賴。

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-redis</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-pool2</artifactId>
        </dependency>

application-redis.properties

#########基礎配置#########
spring.redis.database=0
#spring.redis.url=redis://user:password@example.com:6379
spring.redis.host=
spring.redis.port=
spring.redis.password=
spring.redis.timeout=30000
spring.redis.ssl=false

#########redis哨兵設置#########
#spring.redis.sentinel.master=
#spring.redis.sentinel.nodes=
#spring.redis.cluster.max-redirects=
#spring.redis.cluster.nodes=

#########jedis client 線程池配置#########
#spring.redis.jedis.pool.max-active=
#spring.redis.jedis.pool.max-idle=
#spring.redis.jedis.pool.min-idle=
#spring.redis.jedis.pool.max-wait=

#########lettuce client 線程池配置(默認)#########
spring.redis.lettuce.pool.max-active=10
spring.redis.lettuce.pool.max-idle=5
spring.redis.lettuce.pool.min-idle=1
spring.redis.lettuce.pool.max-wait=20000
spring.redis.lettuce.shutdown-timeout=10

Test

@RunWith(SpringRunner.class)
@SpringBootTest
public class AnnotationAppContextTest {
    @Autowired
    private RedisTemplate<String,String> redisTemplate;
    @Autowired
    private StringRedisTemplate stringRedisTemplate;

    @Test
    public void setTest(){
        redisTemplate.opsForValue().set("key1","val1", 100);
        String key1 = redisTemplate.opsForValue().get("key1");
        System.err.println("=============="+key1);
    }
}

源碼-RedisProperties

@ConfigurationProperties(prefix = "spring.redis")
public class RedisProperties {

    /**
     * Database index used by the connection factory.
     */
    private int database = 0;

    /**
     * Connection URL. Overrides host, port, and password. User is ignored. Example:
     * redis://user:password@example.com:6379
     */
    private String url;

    /**
     * Redis server host.
     */
    private String host = "localhost";

    /**
     * Login password of the redis server.
     */
    private String password;

    /**
     * Redis server port.
     */
    private int port = 6379;

    /**
     * Whether to enable SSL support.
     */
    private boolean ssl;

    /**
     * Connection timeout.
     */
    private Duration timeout;

    private Sentinel sentinel;

    private Cluster cluster;

    private final Jedis jedis = new Jedis();

    private final Lettuce lettuce = new Lettuce();
}   

源碼-RedisAutoConfiguration

@Configuration
@ConditionalOnClass(RedisOperations.class)
@EnableConfigurationProperties(RedisProperties.class)
@Import({ LettuceConnectionConfiguration.class, JedisConnectionConfiguration.class })
public class RedisAutoConfiguration {

    @Bean
    @ConditionalOnMissingBean(name = "redisTemplate")
    public RedisTemplate<Object, Object> redisTemplate(
            RedisConnectionFactory redisConnectionFactory) throws UnknownHostException {
        RedisTemplate<Object, Object> template = new RedisTemplate<>();
        template.setConnectionFactory(redisConnectionFactory);
        return template;
    }

    @Bean
    @ConditionalOnMissingBean(StringRedisTemplate.class)
    public StringRedisTemplate stringRedisTemplate(
            RedisConnectionFactory redisConnectionFactory) throws UnknownHostException {
        StringRedisTemplate template = new StringRedisTemplate();
        template.setConnectionFactory(redisConnectionFactory);
        return template;
    }

}

參考:https://blog.csdn.net/abombhz/article/details/78123253?locationNum=6&fps=1

本文題目:springbootredis
文章分享:http://aaarwkj.com/article16/psocgg.html

成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供用戶體驗網(wǎng)站導航、域名注冊、自適應網(wǎng)站、企業(yè)網(wǎng)站制作、品牌網(wǎng)站制作

廣告

聲明:本網(wǎng)站發(fā)布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經(jīng)允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)

成都定制網(wǎng)站建設
日韩亚洲欧美不卡在线| 麻豆国产av巨做国产剧情| 亚洲成人精品一区二区| 中文字幕久久av一区二区| 精品少妇人妻av不卡久久| 97超频在线观看免费| 国产三级精品久久三级国专区| 亚洲综合一区国产精品| 精品国产一区二区三区大| 成人在线免费观看视频国产| 黄色录像三级黄色录像三级黄色 | 婷婷五五月深爱开心激情| 亚洲大片色一区在线观看| 日本午夜激情一区二区| 欧美午夜福利在线电影| 欧美欧美欧美欧美一区| 日韩女同一区二区三区在线观看| 色婷婷中文字幕久久久| 亚洲免费麻豆一区二区三区| 日本人妻内射一区二区| 亚洲一区二区精品欧美日韩| 亚洲激情一区在线观看| 国产白丝精品爽爽久久| 欧美一级特黄大片做受| 中文字幕韩国三级电影| 久久婷婷综合激情亚洲| 黑人巨大精品欧美久久| 亚洲精品一区二区三区不卡| 日吊视频在线免费观看| 午夜免费视频观看在线| 国产亚洲精品视频免费| 亚洲精品a在线观看av| 欧美黄色一区在线观看| 欧美日韩一区二区三区四区高清视频| 熟女少妇a一区二区三区| 九九在线免费视频蜜臀| 99精品一二三日韩| 国产日韩精品一区二区三区在线| 哪里可以看日韩免费毛片| 男女啪啪国产精品视频| 激情亚洲综合一区二区|