Skip to content

Spring Data Redis issue with CRUDRepository #2146

@arianlopezc

Description

@arianlopezc

My team and I are using a CRUD repository with Redis to perform some operations on it. The problem is that there is an entry in Redis that gets generated as an index which stores the keys associated to the Redis entries, and this entry never removes entries that were already flushed when TTL reached 0.

Here is an example of the code we use.

@RedisHash("rate")
public class RateRedisEntry implements Serializable {
    @Id
    private String tenantEndpointByBlock; // A HTTP end point
    ...
}

// CRUD repository.
@Repository
public interface RateRepository extends CrudRepository<RateRedisEntry, String> {}

This generates the entry rate in Redis which is the Set object I mentioned before.

When we check the memory usage on it, it just keeps growing all the time until the memory usage reaches 100% from the available in Redis.'

MEMORY USAGE "rate"
(integer) 153034
.
.
MEMORY USAGE "rate"
(integer) 153876
.
.
MEMORY USAGE "rate"
(integer) 163492

Is there a way to prevent this index from being created or for the values stored to be removed once the entries' TTL reaches 0?

Any assistance is appreciated.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions