- Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
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