Skip to content

Latest commit

 

History

History
38 lines (34 loc) · 1.2 KB

jedis-instead-of-lettuce.adoc

File metadata and controls

38 lines (34 loc) · 1.2 KB

Use Jedis Instead of Lettuce

By default, the Spring Boot starter (spring-boot-starter-data-redis) uses Lettuce. You need to exclude that dependency and include the Jedis one instead. Spring Boot manages both of these dependencies so you can switch to Jedis without specifying a version.

The following example shows how to do so in Maven:

<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-data-redis</artifactId>
	<exclusions>
		<exclusion>
			<groupId>io.lettuce</groupId>
			<artifactId>lettuce-core</artifactId>
		</exclusion>
	</exclusions>
</dependency>
<dependency>
	<groupId>redis.clients</groupId>
	<artifactId>jedis</artifactId>
</dependency>

The following example shows how to do so in Gradle:

dependencies {
	implementation('org.springframework.boot:spring-boot-starter-data-redis') {
	    exclude group: 'io.lettuce', module: 'lettuce-core'
	}
	implementation 'redis.clients:jedis'
	// ...
}