We now accept unknown custom Redis commands when using the Lettuce driver. Previously, custom commands were required to exist in Lettuce's CommandType enumeration and unknown commands (such as modules) failed to run.
Closes#1979
This commit makes sure to clean up resources when a previously expiring entity is persisted by setting the time to live to zero or negative.
In case a phantom copy exists for the changed entity, it is removed to free space on the server and prevent expiration events from being sent.
Closes#1955
Original Pull Request: #1961
We now support ZREMRANGEBYLEX for Synchronous, Reactive, ZSetOperations and RedisZSet.
Also provide a Kotlin coroutines variant via the extension for ReactiveZSetOperations.
Closes#1816.
Original pull request: #1968.
This commit fixes an issue where the order of elements in a set is not preserved when converting elements of the set.
Closes#1969.
Original pull request: #1968.
Move the no op identity converter to Converters and reuse those across the connection package.
Fix nullables and minor code format issues along the way.
See: #1951
Original Pull Request: #1960
We now use JedisInvoker to call Jedis and Pipeline methods for synchronous, pipelining, and transactional execution models. JedisInvoker captures the method invocation as functional utility and allows conversion of results:
Long result = invoker.just(BinaryJedis::geoadd, MultiKeyPipelineBase:geoadd, key, point.getX(), point.getY(), member);
Closes#1951
Original Pull Request: #1960
Use lambdas where possible. Deprecate unused methods. Favor LettuceInvoker conversion methods over List to List/List to Set converters.
See #1797
Original Pull Request #1948
We now use LettuceInvoker to call Lettuce API methods for synchronous, pipelining, and transactional execution models. LettuceInvoker captures the method invocation as functional utility and allows conversion of results:
Long result = invoker.just(RedisGeoAsyncCommands::geoadd, key, point.getX(), point.getY(), member);
List<byte[]> result = invoker.fromMany(RedisGeoAsyncCommands::geohash, key, members)
.toList(it -> it.getValueOrElse(null));
Closes#1797
Original Pull Request #1948
Reading and deserialization in StreamReceiver and StreamMessageListener is now decoupled from each other to allow fine-grained control over errors and resumption.
Previously, we used the Template API to read and deserialize stream records. Now the actual read happens before the deserialization so that errors during deserialization of individual messages can be handled properly. This split also allows advancing in the stream read. Previously, the failed deserialization prevented of getting hold of the non-serialized Stream record which caused the stream receiver to remain at the offset that fetched the offending record which effectively lead to an infinite loop.
We also support a resume function in StreamReceiver to control whether stream reads should be resumed or terminated.
Original Pull Request: #576
We now correctly consider the transactional state along with the requested bindings scope when binding RedisConnection for reuse.
Previously, enabling transaction support on RedisTemplate registered the connection unconditionally with TransactionSynchronizationManager expecting a TransactionManager to close/unbind the connection upon transaction cleanup. This behavior could easily lead to lingering connections when a transactional RedisTemplate was used outside of a managed transaction.
We now distinguish between closure-scope binding and transaction binding.
Closure-scoped bindings (RedisTemplate.execute(SessionCallback)) do not interfere with transactional resources if there's no transactionally bound RedisConnection.
Closure-scope however reuses a transactionally bound connection.
Transaction-scoped binding binds only a connection to the transaction if there's an active transaction. Without an ongoing transaction, RedisTemplate does no longer bind connections to TransactionSynchronizationManager.
Original Pull Request: #573
We now consider List and subtypes of List to be returned as MULTI return type. Previously, List subtypes were considered to represent the value type.
Original Pull Request: #571
Remove overly pessimistic null checks. Use constant when channel/body are empty to avoid allocations. Remove superfluous final keywords.
Original pull request: #559.
Move keepTTL to Expiration and remove superfluous methods from interfaces. Add tests for reactive variant and work around an open issue in Jedis to support KEEPTTL though the API does not offer that option directly.
Original Pull Request: #562
Remove justId from XClaimOptions and set the flag inside xClaimJustId to avoid errors when processing justId inside xClaim having a different return type.
Original Pull Request: #567
Replace limit != null checks with limit.isUnlimited() for non nullable parameters and adapt constructor visibility to owning class level.
Original Pull Request: #564
Add author and since tags. Introduce separate approximate() method instead of changing count(…) to retain backwards compatibility.
Original pull request: #561.