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\")
Navin Viswanath, thank you for the solution! How did you find it, using docs or debugging?
For those who use Gradle, here is my combination:
Versions:
build.gradle:
repositories {
mavenCentral()
maven { url 'http://repo.spring.io/release/' }
maven { url 'http://repo.spring.io/milestone/' }
}
dependencies {
compile group: 'redis.clients', name: 'jedis', version: '2.7.2'
compile group: 'org.springframework.data', name: 'spring-data-redis', version: '1.6.0.M1'
}
Please note that Spring Data Redis 1.6.0.M1 will be removed once it becomes release, you need to change it to 1.6.0.RELEASE when it is available as release.
So, I checked for version compatibility here: https://github.com/spring-projects/spring-data-redis/blob/master/gradle.properties and found related JIRA ticket here: https://jira.spring.io/browse/DATAREDIS-396
had a similar problem with spring-boot-starter-data-redis 2.0.4
when i implicitly put the dependency to jedis in the app pom.xml it somehow worked
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>2.9.0</version>
</dependency>
eclipse complains about "Duplicating managed version", but everything else works
Turns out I was using Jedis 2.7.2 but Spring Data Redis 1.5.0 seems to be compatible with Jedis 2.6.2. I wish this were a little clearer in the documentation somehow.
Compatible version:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
<version>2.0.4.RELEASE</version>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>2.9.0</version>
</dependency>