From e85ce9f7f3328014d03726770859a0a2024dfdc7 Mon Sep 17 00:00:00 2001 From: Gustav Grusell Date: Wed, 27 Mar 2024 13:43:32 +0100 Subject: [PATCH] fix: add configuration property that allows disabling setting of notify-keyspace-events on redis server Before this fix, when starting encore, spring data redis would try to use the CONFIG command to set notify-keyspace-events on the redis server. If the server did not support the CONFIG command, which is the case in many managed redis services, encore would fail to start. With this fix, setting the property redis.keyspace.disable-config-notifications to true string will stop spring data redis from trying to change the config. If the property is not set, or set to true, spring data redis will behave as before, that is use the CONFIG command to set 'notify-keyspace-events'. Note that this fix does not seem to work when native compile is used. Signed-off-by: Gustav Grusell --- .../src/main/kotlin/se/svt/oss/encore/RedisConfiguration.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/encore-common/src/main/kotlin/se/svt/oss/encore/RedisConfiguration.kt b/encore-common/src/main/kotlin/se/svt/oss/encore/RedisConfiguration.kt index d48ddbd..fb2a70e 100644 --- a/encore-common/src/main/kotlin/se/svt/oss/encore/RedisConfiguration.kt +++ b/encore-common/src/main/kotlin/se/svt/oss/encore/RedisConfiguration.kt @@ -43,7 +43,10 @@ import se.svt.oss.mediaanalyzer.file.VideoFile SegmentProgressEvent::class, QueueItem::class ) -@EnableRedisRepositories(enableKeyspaceEvents = RedisKeyValueAdapter.EnableKeyspaceEvents.ON_STARTUP) +@EnableRedisRepositories( + enableKeyspaceEvents = RedisKeyValueAdapter.EnableKeyspaceEvents.ON_STARTUP, + keyspaceNotificationsConfigParameter = "#{\${redis.keyspace.disable-config-notifications:false} ? '' : 'Ex'}" +) class RedisConfiguration { @Bean