Embedded Redis for Spring Boot

前端 未结 4 1816
死守一世寂寞
死守一世寂寞 2021-01-30 05:27

I run my Integration Test cases with Spring Boot with the help of my local Redis server on my machine.

But I want an embedded Redis server which is not dependent on any

4条回答
  •  南方客
    南方客 (楼主)
    2021-01-30 05:53

    you can see this repository: https://github.com/caryyu/spring-embedded-redis-server , fully integrated with Spring and Spring Boot

    maven dependency

    
    com.github.caryyu
    spring-embedded-redis-server
    1.1
    
    

    spring boot annotation

    @Bean
    public RedisServerConfiguration redisServerConfiguration() {
    return new RedisServerConfiguration();
    }
    

    usage of application.yml

    spring:
        redis:
            port: 6379
            embedded: true
    

提交回复
热议问题