Skip to content

Add support for redis streams XTRIM eviction by ID, aka MINID #2250

@lrozek

Description

@lrozek

At the moment there is only support for eviction to the maximum length of a stream, aka MAXLEN
Please also consider adding support for MINID as in https://redis.io/commands/xtrim

spring classes that support XTRIM with MAXLEN but not MINID
StreamOperations#trim https://github.com/spring-projects/spring-data-redis/blob/3.0.x/src/main/java/org/springframework/data/redis/core/StreamOperations.java#L539 and https://github.com/spring-projects/spring-data-redis/blob/3.0.x/src/main/java/org/springframework/data/redis/core/StreamOperations.java#L552
RedisStreamCommands#xTrim https://github.com/spring-projects/spring-data-redis/blob/3.0.x/src/main/java/org/springframework/data/redis/connection/RedisStreamCommands.java#L909 and https://github.com/spring-projects/spring-data-redis/blob/3.0.x/src/main/java/org/springframework/data/redis/connection/RedisStreamCommands.java#L922

lettuce already offers API to trim by MINID
RedisStreamAsyncCommands#xtrim with XTrimArgs argument, XTrimArgs has minId field for that https://github.com/lettuce-io/lettuce-core/blob/main/src/main/java/io/lettuce/core/api/async/RedisStreamAsyncCommands.java#L366

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions