We added Jedis-/LettuceClientConfiguration and mutable Jedis-/LettuceClientConfiguration to encapsulate Jedis/Lettuce specific client features. Those should be used for ConnectionFactory configuration.
Additionally we added RedisStandaloneConfiguration next to the existing configurations for Sentinel and Cluster.
Along the way we also removed superfluous test system properties and Gemfire specific hooks and truststore customization.
Original Pull Request: #236
Upgrade to Lettuce using Reactor 3.1.0.BUILD-SNAPSHOT, requires change to io.lettuce:lettuce-core, so we also needed to change imports from com.lambdaworks.redis to io.lettuce.core.
Original pull request: #245.
Add ReactiveRedisTemplate, add tests abd add SerializerFunction and DeserializerFunction for functional Redis argument serialization.
Introduce ReactiveRedisConnectionFactory and remove reactive RedisConnectionFactory methods to break the dependency to reactive types. We now no longer require Project Reactor for blocking Redis use. ReactiveRedisTemplate accepts ReactiveRedisConnectionFactory to operate on a reactive connection. The only implementation of ReactiveRedisConnectionFactory is LettuceConnectionFactory which requires by default Project Reactor.
Original Pull Request: #239
Enhance JavaDoc. Improve assertions. Reduce accepted collection-type boundary to Collection for commands that do not enforce a specific order. Add ByteUtil.getBytes(ByteBuffer) utility method. Reformat code. Extend documentation
Fix parameter ambiguity in LettuceConnection.watch().
Original pull request: #229.
We introduced reactor based reactive connection support via ReactiveRedisConnection and ReactiveRedisClusterConnection.
A reactive connection can be obtained via the ConnectionFactory. This is currently only possible when using the Lettuce Redis driver.
Original pull request: #229.
We now support Jedis 2.9.0 with Redis Standalone SSL and Redis Cluster with passwords. The code is compatible with Jedis 2.8.0 when not using SSL or Redis Cluster with passwords.
Original Pull Request: #211
Update jedis driver to 2.8.1. Use binary method for SSCAN and implement ZSCAN and HSCAN methods. Move ScanOptions to ScanParams conversion to JedisConverters.
Original Pull Request: #178
We ship converters for JSR-310 types (LocalDate/Time, ZonedDateTime, Period, Duration and ZoneId) to map between UTF-8-encoded byte[] and JDK 8 date/time types.
We also export Redis Repositories in a CDI environment. Repositories can be injected using @Inject. The CDI extension requires at least RedisOperations to be provided. Other beans like RedisKeyValueAdapter and RedisKeyValueTemplate can be provided by the user. If no RedisKeyValueAdapter/RedisKeyValueTemplate beans are found, the CDI extension creates own managed instances.
Original Pull Request: #156
We now enable storing domain object as a flat Redis 'HASH' and maintain additional 'SET' structures to enable finder operations on simple properties.
@RedisHash("persons");
class Person {
@id String id;
@Indexed String firstname;
String lastname;
Map<String, String> attributes;
City city;
@Reference Person mother;
}
The above is stored in the HASH with key 'persons:1' as
_class = org.example.Person
id = 1
firstname = rand
lastname = al’thor
attributes.[eye-color] = grey
attributes.[hair-color] = red
city.name = emond's field
city.region = two rivers
mother = persons:2
Complex types are flattened out to their full property path for each of the values provided. If the properties actual value type does not match the declared one the '_class' type hint is added to the entry.
city._class = CityInAndor.class
city.name = emond's field
city.region = two rivers
city.country = andor
Map and Collection like structures are stored with their key/index values as part of the property path. If the map/collection value type does not match the actutal objects one the '_class' type hint is added to the entry.
list.[0]._class = DomainType.class
list.[0].property1 = ...
map.[key-1]._class = DomainType.class
map.[key-1].property1 = ...
Properties marked with '@Reference' are stored as semantic references by just storing the key to the referenced object 'HASH' instead of embedding its values.
mother = persons:2
Please note that referenced objects are not transitively updated/saved and that lazy loading of references will be part of future development.
A 'save' operation therefore executes the following:
# flatten domain type and add as hash
HMSET persons:1 id 1 firstname rand …
# add the newly inserted entry to the list of all entries of that type
SADD persons 1
# index the firstname for finder lookup
SADD persons.firstname:rand 1
Simple finder operation like 'findByFirstname' use 'SINTER' to find matching
SINTER persons.firstname:rand
HGETALL persons:1
Besides resolving an index via the '@Index' annotation we also allow to add custom configuration via the 'indexConfiguration' attribute of '@EnableRedisRepositories'.
@Configuration
@EnableRedisRepositories(indexConfiguration = CustomIndexConfiguration.class)
class Config { }
static class CustomIndexConfiguration extends IndexConfiguration {
@Override
protected Iterable<RedisIndexDefinition> initialConfiguration() {
return Arrays.asList(
new SimpleIndexDefinition("persons", "lastname"),
);
}
}
The '@TimeToLive' annotation allows to define a property or method providing an expiration time when storing the key in redis.
@RedisHash
class Person {
@Id String id;
@TimeToLive Long ttl;
}
Original Pull Request: #156