Skip to main content
This quickstart adds the FlowWarden Redis backend to an existing Spring Boot application that already uses flowwarden-stream-core. After these three steps, your LockService and CheckpointStore beans are backed by Redis instead of MongoDB.

1. Add the dependency

<dependency>
    <groupId>io.flowwarden</groupId>
    <artifactId>flowwarden-redis</artifactId>
    <version>1.0.0-rc.1</version>
</dependency>
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
implementation 'io.flowwarden:flowwarden-redis:1.0.0-rc.1'
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
flowwarden-redis requires spring-boot-starter-data-redis on the classpath. Spring Boot creates the StringRedisTemplate bean that flowwarden-redis needs, and resolves the underlying Lettuce or Jedis client.

2. Configure Redis

Use the standard Spring Boot properties for the Redis connection:
application.yml
spring:
  data:
    redis:
      host: localhost
      port: 6379
Optionally, namespace the Redis keys written by FlowWarden — useful when the Redis instance is shared with other apps or other tenants:
application.yml
flowwarden:
  redis:
    key-prefix: "myapp:"   # default: "fw:"
That’s the only FlowWarden-specific property. See Configuration for the full reference.

3. Use your stream as usual

Your @ChangeStream / @Checkpoint annotations don’t change. The Redis-backed beans are picked up automatically when the application context starts:
MyStream.java
@ChangeStream(documentType = Order.class)
@Checkpoint
public class OrderStream {

    @OnChange
    void handle(ChangeStreamContext<Order> ctx) {
        System.out.println(ctx.summary());
    }
}

Verify

Start the application and check the bean wiring. Either look for the Spring Boot startup banner followed by no BeanCreationException, or print the active beans:
MyApp.java
@SpringBootApplication
@EnableFlowWarden
public class MyApp {
    public static void main(String[] args) {
        ConfigurableApplicationContext ctx = SpringApplication.run(MyApp.class, args);
        System.out.println("LockService:     " + ctx.getBean(LockService.class).getClass().getSimpleName());
        System.out.println("CheckpointStore: " + ctx.getBean(CheckpointStore.class).getClass().getSimpleName());
    }
}
Expected output:
LockService:     RedisLockService
CheckpointStore: RedisCheckpointStore
If you see MongoLockService / MongoCheckpointStore instead, check that spring-boot-starter-data-redis is on the classpath and that a StringRedisTemplate bean exists (Spring Boot creates one whenever the starter resolves a working connection).
flowwarden-redis provides the backend implementations only. You still need flowwarden-stream-core for the @ChangeStream / @Checkpoint annotation engine and a MongoDB Change Stream source to watch — Redis replaces only the coordination state, not the event source.

See Also

Configuration

Properties, storage layout, reactive variants, hybrid setups.

@Checkpoint reference

The annotation that drives the CheckpointStore SPI Redis backs here.