public abstract class Redis
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static RedisDataStoreBuilder |
dataStore()
Returns a builder object for creating a Redis-backed data store.
|
public static RedisDataStoreBuilder dataStore()
This object can be modified with RedisDataStoreBuilder
methods for any desired
custom Redis options. Then, pass it to Components.persistentDataStore(com.launchdarkly.client.interfaces.PersistentDataStoreFactory)
and set any desired caching options. Finally, pass the result to
LDConfig.Builder.dataStore(com.launchdarkly.client.FeatureStoreFactory)
.
For example:
LDConfig config = new LDConfig.Builder()
.dataStore(
Components.persistentDataStore(
Redis.dataStore().url("redis://my-redis-host")
).cacheSeconds(15)
)
.build();