Cannot get connection for redisTemplate for Spring data redis

后端 未结 10 2029
太阳男子
太阳男子 2020-12-05 21:25

I\'m trying to publish a message to a channel using Spring data Redis using Jedis. Here is a very simple Java config:

@Bean(name=\"jedisConnectionFactory\")
         


        
10条回答
  •  时光取名叫无心
    2020-12-05 21:49

    I have also faced a similar kind of issue. I did some research and found out that it is due to a jar conflict.

    Compatible version i am using in my application is :

    
        org.springframework.data
        spring-data-redis
        1.8.10.RELEASE
    
    
        redis.clients
        jedis
        2.9.0
    
    

    Or if you are using spring boot simply add the following dependency. Spring boot is smart enough to auto resolve such issues.

    
        org.springframework.boot
        spring-boot-starter-data-redis
    
    

    I hope it helps !!

提交回复
热议问题