Create unit tests for RedisAtomic counter initialization. Refactor setIfAbsent(…) method to initializeIfAbsent() to not expose additional API methods.
Original pull request: #367.
We now catch exceptions that may occur during unsubscription from the subscribed patterns/channels.
Previously, RuntimeExceptions were not caught and prevented a fast shutdown of the ApplicationContext.
Original Pull Request: #346
Backport of RedisQueryEngine#count(RedisOperationChain, Serializable) fix using multiple indexed keys.
Related ticket: DATAREDIS-605.
Original pull request: #330.
We now rely more on Jedis to select the appropriate Redis database and we no longer select the database when opening/closing a connection. Previously, we always reset the database if a database index greater zero was configured.
A properly configured Jedis pool ensures that the appropriate database is selected even if the database was selected during connection interaction.
Relying on Jedis reduces the number of issued SELECT commands and improves that way overall performance when executing commands via the Template API.
Original Pull Request: #291.
Original ticket: DATAREDIS-714.
Added test with decimal and date map keys to verify those are flattened out correctly using the converters registered and updated documentation to point out limitation of map keys to simple types.
Original Pull Request: #312
We now consider the key type when reading a map from a Redis Hash. Previously, map keys were read as string while a map could declare numeric keys.
Original Pull Request: #312
We now prevent false positive cache hits after checking for key presence and the Redis key gets removed before fetching its value.
This can happen if we check positively for presence but the key expires (TTL) or gets removed before the GET call is able to fetch the value.
Previously, we returned a RedisCacheElement wrapping null without regard to whether the cache is able to store/return null values. We now inspect the returned value for presence to eagerly return a negative cache hit and to preserve cached null values.
Original Pull Request: #310
We now enable/disable SSL usage when configuring JedisConnectionFactory with JedisShardInfo based on the configured SSL use in JedisShardInfo.
Original Pull Request: #308
We now enable pool usage when configuring JedisConnectionFactory with RedisSentinelConfiguration to prevent accidental connections using the non-pooled standalone configuration. Jedis can operate with Sentinel only with pooling.
We also reject calls to disable pooling when JedisConnectionFactory is configured to use Sentinel.
Original Pull request: #307
We now order and assemble results of multi-key commands (e.g. MGET with cross-slot keys) that are executed on different nodes by positional keys to retain duplicate keys in the requested order and retain the server response.
Previously duplicate keys were treated as set of keys and the response didn't match the requested keys.
Original Pull Request: #303
We now support Redis hashes via Repository support that contain colon in their id. We're using colons to split a composite id string into keyspace and id parts. Previously, we partially rejected processing of id's that don't exactly match the number of parts delimited by colon. This caused leftovers in secondary indexes.
Original Pull Request: #298
We now use a fallback exception translation strategy in JedisClusterConnection to map all non-mapped exceptions to RedisSystemException. This change prevents null pointer exceptions caused by potentially throwing null.
Original Pull Request: #275
Parse Spring version for semantic version comparision. Remove redundant cast. Add issue tag to test, Visibility, formatting, imports.
Original pull request: #273.
We now release Jedis cluster node connections with Jedis.close() to the pool instead of Pool.returnResource(…). The close() method itself checks whether the connection was broken and if so, the connection gets destroyed. Destroying broken connections prevents the pool from supplying broken connections on borrow when testOnBorrow is disabled.
The only case where we return broken resources ourselves to the Pool is when we discover a broken connection ourselves: If we run into a NullPointerException or RedisConnectionFailureException, then we consider a connection is broken.
Original Pull Request: #271
We now request a cluster node connection directly from the driver's connection handler and initiate reconfiguration if a cluster node is known through the topology but has no connection pool yet. This can happen if a cluster node is added to the cluster after the connection was initialized.
The connection handler cannot be obtained directly although the field where it's held is protected which increases the amount of necessary test code and reflection access to the connection handler.
Jedis discovers nodes during startup, on demand (full scan) or when requested (e.g. by a cluster redirection).
Original Pull Request: #270
Rename JedisConverters.zAddArgsConvertor(…) to toTupleMap(…) and reorder method to group with other tuple conversion methods. Add author tags.
Create tests for zadd with tuple using Redis Cluster. Enable pipelining and transactions for zadd using Jedis. Adopt tests.
Original pull request: #263.
We now not only configure the underlying lettuce connection with the command timeout set via the connection factory, but also make sure to pass the option on to the LettuceClusterConnection.
Original pull request: #266.
We now shut down ClusterCommandExecutor via LettuceClusterConnection and JedisClusterConnection if the ClusterCommandExecutor was created through the connection instance. In such case ClusterCommandExecutor is managed through Lettuce/JedisClusterConnection and disposed on connection close.
Previously ClusterCommandExecutor created through a ClusterConnection was not disposed.
Original pull request: #247.
We now serialize Enum values using their name (Enum.name()) instead of using their string representation (Enum.toString()). toString can be customized in Enums to no longer report their name but a different value. A customized value cannot be used to reinstantiate the Enum value, only its name.
This change affects serialization and will only affect new/updated values. Stored values with a customized toString representation still can't be deserialized until they were updated in Redis.
Original Pull Request: #235
We now consider the element expiry when retrieving cache elements with a value loader. Previously, all cache elements that were cached using `@Cacheable(sync=true)` or used `RedisCache.get(Object, Callable)` directly were considered eternal without setting a TTL.
Original Pull Request: #234
Run expiry tests only when executing long-running tests. Guard RedisConnectionFactory against multiple initializations. Synchronize key expiry. Remove unused code. Extend years in license header.
Original pull request: #232.
We now no longer rely on ApplicationEvents captured in the RedisKeyValueAdapter for performing cleanup operations for expired keys, but do this along with the phantom key removal. This removes a flaw when initializing a non repository related KeyspaceEventListener publishing events that actually are unrelated to the Adapter.
Additionally upgraded test infrastructure to utilize Redis 3.2.6 with disabled protected-mode and enabled keyspace-events.
Original pull request: #232.
Apply client name to Sentinel and unpooled connections if set. Add ticket references to JavaDoc. Add tests. Fix existing JavaDoc letter casing and punctuation. Rearrange isClusterAware/isRedisSentinelAware methods.
Original pull request: #219.
Motivation:
JedisConnectionFactory should support setting clientName for Jedis connections
so to improve troubleshooting.
Result:
Easier to troubleshooting with connection name.
Original pull request: #219.
Store `NullValue` placeholders when null value caching is allowed. Remove cache values when null value caching is disabled and the value loader returns a `null` value.
Original pull request: #221.
We now support caching `null` values in `RedisCache` by storing a dedicated `NullValue` reference as a placeholder. To enable this feature please set up `RedisCacheManager` accordingly and make sure the used `RedisSerializer` is capable of dealing the `NullValue` type.
Both the `JdkSerializationRedisSerializer` and the `GenericJackson2JsonRedisSerializer` support this out of the box.
Original pull request: #221.