0

We use spring Redis data indexes to fetch some data apart from the key.

We are using Amazon Elastic Cache in a clustered mode.

It seems the Indexed entries are not getting cleared even if the original entries are getting cleared.

In our Redis Configuration we have subscribed to keyspace events on Startup. But it seems keyspace events don't work reliably as internally Spring data Redis subscribes to any random node.

Please check some links below for details

Spring Redis - Indexes not deleted after main entry expires

https://github.com/spring-projects/spring-data-redis/issues/1111

One recommendation is to subscribe to all the master nodes. I am not sure how to subscribe to all the nodes from Spring Data Redis.

Best Regards,

Saurav

saurav
  • 5,388
  • 10
  • 56
  • 101

1 Answers1

0

I think you need the following:

@EnableRedisRepositories(enableKeyspaceEvents = EnableKeyspaceEvents.ON_STARTUP)

Check this question and its answer for further detail.

sazzad
  • 5,740
  • 6
  • 25
  • 42