Skip to content

Latest commit

 

History

History
54 lines (41 loc) · 1.9 KB

File metadata and controls

54 lines (41 loc) · 1.9 KB

embedded-redis

Maven dependency

pom.xml
<dependency>
    <groupId>com.playtika.testcontainers</groupId>
    <artifactId>embedded-redis</artifactId>
    <scope>test</scope>
</dependency>

Consumes (via bootstrap.properties)

  • embedded.redis.enabled (true|false, default is true)

  • embedded.redis.reuseContainer (true|false, default is false)

  • embedded.redis.dockerImage (default is 'redis:8.10.1-alpine')

  • embedded.redis.waitTimeoutInSeconds (default is 60 seconds)

  • embedded.redis.clustered (true|false, default is false)

    • If true Redis is started in cluster mode

  • embedded.redis.requirepass (true|false, default is true)

  • embedded.toxiproxy.proxies.redis.enabled Enables both creation of the container with ToxiProxy TCP proxy and a proxy to the embedded-redis container.

Redis Client Drivers

The embedded-redis module supports both Jedis and Lettuce Redis client drivers:

  • Jedis: Synchronous Redis client (default when Jedis is on classpath)

  • Lettuce: Asynchronous and reactive Redis client, supports cluster mode and reactive operations

Both drivers are optional dependencies. Spring Boot will auto-configure the appropriate connection factory based on which drivers are available on the classpath. To explicitly use Lettuce, configure:

spring.data.redis.client-type=lettuce

The module automatically ensures that LettuceConnectionFactory and JedisConnectionFactory beans depend on the embedded Redis container, ensuring proper startup order.

Produces

  • embedded.redis.host

  • embedded.redis.port

  • embedded.redis.user

  • embedded.redis.password

  • embedded.redis.toxiproxy.host

  • embedded.redis.toxiproxy.port

  • embedded.redis.networkAlias

  • Bean ToxiproxyClientProxy redisContainerProxy