We now renamed RedisStaticMasterSlaveConfiguration and StaticMasterSlaveConnectionProvider to RedisStaticMasterReplicaConfiguration respective StaticMasterReplicaConnectionProvider to reflect changes in Redis nomenclature regarding replication.
Original Pull Request: #355
Refactor lower/upper bound retrieval into LettuceConverters for a consistent lower/upper boundary return value. Use minus one (-1) as the upper bound index to always retrieve the last element if the upper boundary is not bounded.
Original pull request: #353.
We now return in List, String, and ZSet commands a lower/upper bound range index to prevent NullPointerException. Previously, unbounded ranges could render null values that were attempted to cast to primitives.
Original pull request: #353.
We now consider a transactional rollback that returns an empty EXEC result as rollback for the CAS (compare-and-set) operation. Previously, we checked only that the response of EXEC is not null. A rollback returns an empty list which was previously considered a successful CAS operation.
The code for CAS is now extracted to CompareAndSet and is reused from RedisAtomic implementations.
Original Pull Request: #349
We now support immutable objects for saving (e.g. object without a provided Id) and loading (i.e. persistence constructor declares a subset of properties). New instances are created using wither methods/Kotlin copy(…) methods if an immutable object requires association with an Id.
Association of the Id to its object moved from RedisKeyValueAdapter to RedisKeyValueTemplate.
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
We now support IsTrue and IsFalse keywords usage in repository query methods to create queries with predicates for boolean fields values without requiring to pass a boolean argument.
class Person {
@Id String id;
@Indexed Boolean alive;
}
interface PersonRepository extends Repository<Person, String> {
Person findByAliveIsTrue();
Person findByAliveIsFalse();
}
Original Pull Request: #342
We now release the native connection back to the connection provider when LettuceSubscription is closed. Previously, we just closed the connection which interfered with pooling as pooling connection providers still had a reference on the connection.
Original Pull Request: #341
We now provide reactive SCAN support for keys, hashes, sets, and sorted sets. Scanning uses a cursor-based Flux and takes subscriber demand into account to issue the according scan commands once a batch of keys/values/entries was emitted. Specifying a SCAN limit controls the batch (page) size and can be used to optimize the number of roundtrips between the application and Redis.
Original Pull Request: #343
Move BitfieldCommand to top-level type BitFieldSubCommands.
Use primitives in command objects. Add toString methods. Add utility methods to extract responses from Jedis Client. Use Connection.execute(…) to invoke BITFIELD using Jedis. Fix Overflow values to string rendering.
Convert test ticket references to new format.
Original pull request: #227.
We now offer support for BITFIELD via RedisConnection and RedisClusterConnection using Lettuce and Jedis.
connection.bitField(key,
create()
.set(INT_8).valueAt(offset(0).multipliedByTypeLength()).to(100)
.incr(signed(8)).valueAt(offset(102)).overflow(FAIL).by(1));
Original pull request: #227.
Introduce dedicated methods utilizing the ReactiveMessageListenerContainer to create a stream of Messages via ReactiveRedisTemplate.
redisTemplate.listenToChannel("channel1", "channel2").doOnNext(msg -> {
// message processing ...
}).subscribe();
Add close-/destroyLater methods avoiding blocking shutdown of connections and containers.
Original Pull Request: #295
We now provide sending and receiving of Redis Pub/Sub messages with reactive connections. Messages can be sent with ReactiveRedisTemplate and received as infinite stream through ReactiveRedisMessageListenerContainer. ReactiveRedisMessageListenerContainer uses a single connection to multiplex different subscriptions.
Reactive Pub/Sub supports Standalone, Sentinel and Redis Cluster setups.
ReactiveRedisConnectionFactory factory = …;
ReactiveRedisTemplate<String, String> template = new ReactiveRedisTemplate<>(factory, RedisSerializationContext.string());
Mono<Long> publish = template.convertAndSend("hello!", "world");
ReactiveRedisMessageListenerContainer container = new ReactiveRedisMessageListenerContainer(factory);
Flux<ChannelMessage<String, String>> channelMessages = container.receive(new ChannelTopic("foo"));
Flux<PatternMessage<String, String, String>> patternMessages = container.receive(new PatternTopic("foo"));
//
container.destroy();
Original Pull Request: #295
We now provide factory methods to create default serializers/deserializers accepting ClassLoader.
RedisSerializer.java(ClassLoader)
RedisSerializationContext.java(ClassLoader)
RedisCacheConfiguration.defaultCacheConfig(ClassLoader)
Original Pull Request: #333
We now read and convert constructor property values through MappingRedisConverter.readProperty(…) to apply proper conversion. This way, constructor properties are read through the same methods as instance properties allowing to read back nested level entities.
Previously, we were only reading simple properties or properties associated with a registered Converter.
Original Pull Request: #329
Remove DefaultRedisMapEntry as it's no longer required. Simplify test to unit test to reduce test scope and test run time.
Original pull request: #326.
Redis has a limitation of 1024 * 1024 parameters]() for bulk operations.
To receive more than 1024 * 1024 - 1 entries with entrySet(), we can directly use the HGETALL command instead of first fetching the keys with HKEYS and then fetching the values with HMGET.
See also: https://github.com/antirez/redis/blob/4.0.9/src/networking.c#L1200
Original pull request: #326.