From 013bb22c5f4bbe4c90b45b7d182651e97b607cf6 Mon Sep 17 00:00:00 2001 From: Dennis Date: Wed, 13 Oct 2021 17:21:50 +0900 Subject: [PATCH] Added docs to use TTL on AWS ElastiCache The documentation indicates that it's not possible to use the keyspace notification message listener on AWS ElastiCache. The added text describes a way to prevent Spring Data Redis from using the `CONFIG` command and make it possible to use the listener on AWS. It took me some time reading through old issues and pull requests to figure this out, so I thought it might be helpful to others. --- src/main/asciidoc/reference/redis-repositories.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/asciidoc/reference/redis-repositories.adoc b/src/main/asciidoc/reference/redis-repositories.adoc index f953d9309a..600add0294 100644 --- a/src/main/asciidoc/reference/redis-repositories.adoc +++ b/src/main/asciidoc/reference/redis-repositories.adoc @@ -592,7 +592,7 @@ The `RedisKeyExpiredEvent` holds a copy of the expired domain object as well as NOTE: Delaying or disabling the expiry event listener startup impacts `RedisKeyExpiredEvent` publishing. A disabled event listener does not publish expiry events. A delayed startup can cause loss of events because of the delayed listener initialization. -NOTE: The keyspace notification message listener alters `notify-keyspace-events` settings in Redis, if those are not already set. Existing settings are not overridden, so you must set up those settings correctly (or leave them empty). Note that `CONFIG` is disabled on AWS ElastiCache, and enabling the listener leads to an error. +NOTE: The keyspace notification message listener alters `notify-keyspace-events` settings in Redis, if those are not already set. Existing settings are not overridden, so you must set up those settings correctly (or leave them empty). Note that `CONFIG` is disabled on AWS ElastiCache, and enabling the listener leads to an error. To work around this error the `keyspaceNotificationsConfigParameter` parameter must be set to `null` or empty string. This prevents Spring Data Redis from using the `CONFIG` command. NOTE: Redis Pub/Sub messages are not persistent. If a key expires while the application is down, the expiry event is not processed, which may lead to secondary indexes containing references to the expired object.