SpringBoot2.0默认使用Lettuce客户端,如果想要整合Jedis客户端,需要做的是一下两步

    • 将Lettuce客户端依赖spring-boot-starter-data-redis中排除
    • 添加Jedis客户端

      1. <dependency>
      2. <groupId>org.springframework.boot</groupId>
      3. <artifactId>spring-boot-starter-data-redis</artifactId>
      4. <exclusions>
      5. <exclusion>
      6. <groupId>io.lettuce</groupId>
      7. <artifactId>lettuce-core</artifactId>
      8. </exclusion>
      9. </exclusions>
      10. </dependency>
      11. <dependency>
      12. <groupId>redis.clients</groupId>
      13. <artifactId>jedis</artifactId>
      14. </dependency>
      15. <dependency>
      16. <groupId>org.apache.commons</groupId>
      17. <artifactId>commons-pool2</artifactId>
      18. </dependency>