DATAREDIS-1049 - Fix retrieval of empty keyspaceNotificationsConfigParameter used to keep server defaults.

Empty Strings changed to be considered null throwing an exception on getRequiredAttribute so we now set the value explicitly for this attribute when considered empty.

Original pull request: #491.
This commit is contained in:
Christoph Strobl
2019-10-30 10:04:35 +01:00
committed by Mark Paluch
parent 2afb579a94
commit 3dfe7af60e
3 changed files with 17 additions and 2 deletions

View File

@@ -168,7 +168,7 @@ public @interface EnableRedisRepositories {
/**
* Configure the {@literal notify-keyspace-events} property if not already set. <br />
* Use an empty {@link String} to keep <b>not</b> alter existing server configuration.
* Use an empty {@link String} to keep (<b>not</b> alter) existing server configuration.
*
* @return {@literal Ex} by default.
* @since 1.8

View File

@@ -144,7 +144,7 @@ public class RedisRepositoryConfigurationExtension extends KeyValueRepositoryCon
.addPropertyValue("enableKeyspaceEvents",
configuration.getRequiredAttribute("enableKeyspaceEvents", EnableKeyspaceEvents.class)) //
.addPropertyValue("keyspaceNotificationsConfigParameter",
configuration.getRequiredAttribute("keyspaceNotificationsConfigParameter", String.class)) //
configuration.getAttribute("keyspaceNotificationsConfigParameter", String.class).orElse("")) //
.getBeanDefinition();
}