spring-data-redis icon indicating copy to clipboard operation
spring-data-redis copied to clipboard

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

Open lrozek opened this issue 3 years ago • 2 comments

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

lrozek avatar Jan 27 '22 10:01 lrozek

Any ETA on this, or a workaround (e.g., sending custom commands to redis via redis template)?

ddovbis avatar Jun 28 '23 09:06 ddovbis