INT-4507: Use UNLINK in RedisMessageStore if any

JIRA: https://jira.spring.io/browse/INT-4507

* Add `RedisUtils` with the `isUnlinkAvailable()` to check the Redis
server version to be sure that `UNLINK` is available or not
* Use `RedisUtils.isUnlinkAvailable()` in the `RedisMessageStore` and
`RedisLockRegistry` when a removal functionality is performed
* Add `AbstractKeyValueMessageStore.doRemoveAll(Collection<Object> ids)`
for optimization
* Implement `doRemoveAll()` in the `RedisMessageStore` and
`GemfireMessageStore`

**Cherry-pick to 5.0.x**
This commit is contained in:
Artem Bilan
2018-07-25 14:04:18 -04:00
committed by Gary Russell
parent d61cd790fe
commit 88c7646ed9
6 changed files with 137 additions and 20 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -96,6 +96,11 @@ public class GemfireMessageStore extends AbstractKeyValueMessageStore {
return this.messageStoreRegion.remove(id);
}
@Override
protected void doRemoveAll(Collection<Object> ids) {
this.messageStoreRegion.removeAll(ids);
}
@Override
protected Collection<?> doListKeys(String keyPattern) {
Assert.hasText(keyPattern, "'keyPattern' must not be empty");