Nick Fisher's tech blog

Redis

How to Configure Lettuce to connect to a local Redis Instance with Webflux

The source code for this post can be found on Github.

In a previous post, we detailed how to write integration tests for lettuce clients in spring boot webflux using a redis test container. That’s fine and well when you’re just writing code for a quick feedback loop, but is useless when it comes to running the application in real life. This post will start up redis locally and then explain how to best connect to it using lettuce in webflux.

How to use a Redis Test Container with Lettuce/Spring Boot Webflux

The source code for this post can be found on Github.

Another way to write integration tests for code that verifies your interactions with redis actually make sense is to use a test container. This framework assumes you have docker up and running, but if you do it will pull a specified container image [typically you’ll just use docker hub, though it’s important to note that they rate limit you, so don’t go overboard], then you can interact with that container in your integration tests.

Newer Posts