From a61327766ee89250a39f6923e7687aa5766f342d Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Tue, 7 Nov 2017 15:59:54 -0500 Subject: [PATCH] GH-2207: Clarify RedisMetadataStore in cluster Resolves: spring-projects/spring-integration#2207 * Since the `WATCH` command isn't supported on clustered connections, the `RedisMetadataStore.replace()` operation can't be used there. Document this limitation --- .../redis/metadata/RedisMetadataStore.java | 11 ++++++++--- src/reference/asciidoc/redis.adoc | 2 ++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/spring-integration-redis/src/main/java/org/springframework/integration/redis/metadata/RedisMetadataStore.java b/spring-integration-redis/src/main/java/org/springframework/integration/redis/metadata/RedisMetadataStore.java index 0f8efd9908..1f8d3f9b9f 100644 --- a/spring-integration-redis/src/main/java/org/springframework/integration/redis/metadata/RedisMetadataStore.java +++ b/spring-integration-redis/src/main/java/org/springframework/integration/redis/metadata/RedisMetadataStore.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2016 the original author or authors. + * Copyright 2013-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,11 +26,16 @@ import org.springframework.integration.metadata.MetadataStore; import org.springframework.util.Assert; /** - * Redis implementation of {@link MetadataStore}. Use this {@link MetadataStore} - * to achieve meta-data persistence across application restarts. + * Redis implementation of {@link MetadataStore}. Use this {@link MetadataStore} to + * achieve meta-data persistence across application restarts. + *

+ * This implementation is based on the {@link RedisProperties} and its + * {@link #replace(String, String, String)}; it can't currently be used with a Redis + * cluster because the {@code WATCH} command is not supported. * * @author Gunnar Hillert * @author Artem Bilan + * * @since 3.0 */ public class RedisMetadataStore implements ConcurrentMetadataStore { diff --git a/src/reference/asciidoc/redis.adoc b/src/reference/asciidoc/redis.adoc index 5a3c477383..fe48fd7860 100644 --- a/src/reference/asciidoc/redis.adoc +++ b/src/reference/asciidoc/redis.adoc @@ -418,6 +418,8 @@ By default this `key` has the value `MetaData`. Starting with _version 4.0_, this store now implements `ConcurrentMetadataStore`, allowing it to be reliably shared across multiple application instances where only one instance will be allowed to store or modify a key's value. +IMPORTANT: The `RedisMetadataStore.replace()` (for example in the `AbstractPersistentAcceptOnceFileListFilter`) can't be used with a Redis cluster since the `WATCH` command for atomicity is not currently supported. + [[redis-store-inbound-channel-adapter]] === RedisStore Inbound Channel Adapter