Class ReactiveRedisTemplate<K,V>
- Type Parameters:
K
- the Redis key type against which the template works (usually a String)V
- the Redis value type against which the template works
- All Implemented Interfaces:
ReactiveRedisOperations<K,
V>
- Direct Known Subclasses:
ReactiveStringRedisTemplate
ReactiveRedisOperations
.
Performs automatic serialization/deserialization between the given objects and the underlying binary data in the Redis store.
Note that while the template is generified, it is up to the serializers/deserializers to properly convert the given Objects to and from binary data.
Streams of methods returning Mono<K>
or Flux<M>
are terminated with
InvalidDataAccessApiUsageException
when
RedisElementReader.read(ByteBuffer)
returns null
for a
particular element as Reactive Streams prohibit the usage of null
values.
- Since:
- 2.0
- Author:
- Mark Paluch, Christoph Strobl, Petromir Dzhunev, John Blum
-
Constructor Summary
ConstructorDescriptionReactiveRedisTemplate
(ReactiveRedisConnectionFactory connectionFactory, RedisSerializationContext<K, V> serializationContext) Creates newReactiveRedisTemplate
using givenReactiveRedisConnectionFactory
andRedisSerializationContext
.ReactiveRedisTemplate
(ReactiveRedisConnectionFactory connectionFactory, RedisSerializationContext<K, V> serializationContext, boolean exposeConnection) Creates newReactiveRedisTemplate
using givenReactiveRedisConnectionFactory
andRedisSerializationContext
. -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<Long>
convertAndSend
(String destination, V message) Publishes the given message to the given channel.reactor.core.publisher.Mono<Boolean>
Copy givensourceKey
totargetKey
.<T> reactor.core.publisher.Flux<T>
createFlux
(ReactiveRedisCallback<T> callback) Create a reusable Flux for aReactiveRedisCallback
.<T> reactor.core.publisher.Mono<T>
createMono
(ReactiveRedisCallback<T> callback) Create a reusable Mono for aReactiveRedisCallback
.protected ReactiveRedisConnection
createRedisConnectionProxy
(ReactiveRedisConnection reactiveRedisConnection) final reactor.core.publisher.Mono<Long>
Delete givenkey
.reactor.core.publisher.Mono<Long>
Delete givenkeys
.<T> reactor.core.publisher.Flux<T>
execute
(ReactiveRedisCallback<T> action) Executes the given action within a Redis connection.<T> reactor.core.publisher.Flux<T>
execute
(ReactiveRedisCallback<T> action, boolean exposeConnection) Executes the given action object within a connection that can be exposed or not.<T> reactor.core.publisher.Flux<T>
execute
(RedisScript<T> script, List<K> keys, List<?> args) Executes the givenRedisScript
<T> reactor.core.publisher.Flux<T>
execute
(RedisScript<T> script, List<K> keys, List<?> args, RedisElementWriter<?> argsWriter, RedisElementReader<T> resultReader) Executes the givenRedisScript
, using the providedRedisSerializer
s to serialize the script arguments and result.<T> reactor.core.publisher.Flux<T>
executeInSession
(ReactiveRedisSessionCallback<K, V, T> action) Executes the given action within a Redis session using the sameReactiveRedisConnection
.reactor.core.publisher.Mono<Boolean>
Set time to live for givenkey
.reactor.core.publisher.Mono<Boolean>
Set the expiration for givenkey
as a expireAt timestamp.protected reactor.core.publisher.Mono<ReactiveRedisConnection>
Creates aMono
which emits a newReactiveRedisConnection
.Returns the connectionFactory.reactor.core.publisher.Mono<Duration>
Get the time to live forkey
.reactor.core.publisher.Mono<Boolean>
Determine if givenkey
exists.reactor.core.publisher.Flux<K>
Find all keys matching the givenpattern
.reactor.core.publisher.Flux<? extends ReactiveSubscription.Message<String,
V>> reactor.core.publisher.Mono<reactor.core.publisher.Flux<? extends ReactiveSubscription.Message<String,
V>>> listenToLater
(Topic... topics) reactor.core.publisher.Mono<Boolean>
Move givenkey
to database withindex
.Returns geospatial specific operations interface.<K1,
V1> ReactiveGeoOperations<K1, V1> opsForGeo
(RedisSerializationContext<K1, V1> serializationContext) Returns geospatial specific operations interface.<HK,
HV> ReactiveHashOperations<K, HK, HV> Returns the operations performed on hash values.<K1,
HK, HV> ReactiveHashOperations<K1, HK, HV> opsForHash
(RedisSerializationContext<K1, ?> serializationContext) Returns the operations performed on hash values given aRedisSerializationContext
.Returns the operations performed on multisets using HyperLogLog.<K1,
V1> ReactiveHyperLogLogOperations<K1, V1> opsForHyperLogLog
(RedisSerializationContext<K1, V1> serializationContext) Returns the operations performed on multisets using HyperLogLog given aRedisSerializationContext
.Returns the operations performed on list values.<K1,
V1> ReactiveListOperations<K1, V1> opsForList
(RedisSerializationContext<K1, V1> serializationContext) Returns the operations performed on list values given aRedisSerializationContext
.Returns the operations performed on set values.<K1,
V1> ReactiveSetOperations<K1, V1> opsForSet
(RedisSerializationContext<K1, V1> serializationContext) Returns the operations performed on set values given aRedisSerializationContext
.<HK,
HV> ReactiveStreamOperations<K, HK, HV> Returns the operations performed on streams.<HK,
HV> ReactiveStreamOperations<K, HK, HV> opsForStream
(HashMapper<? super K, ? super HK, ? super HV> hashMapper) Returns the operations performed on streams.<HK,
HV> ReactiveStreamOperations<K, HK, HV> opsForStream
(RedisSerializationContext<K, ?> serializationContext) Returns the operations performed on streams given aRedisSerializationContext
.protected <HK,
HV> ReactiveStreamOperations<K, HK, HV> opsForStream
(RedisSerializationContext<K, ?> serializationContext, HashMapper<? super K, ? super HK, ? super HV> hashMapper) Returns the operations performed on simple values (or Strings in Redis terminology).<K1,
V1> ReactiveValueOperations<K1, V1> opsForValue
(RedisSerializationContext<K1, V1> serializationContext) Returns the operations performed on simple values (or Strings in Redis terminology) given aRedisSerializationContext
.Returns the operations performed on zset values (also known as sorted sets).<K1,
V1> ReactiveZSetOperations<K1, V1> opsForZSet
(RedisSerializationContext<K1, V1> serializationContext) Returns the operations performed on zset values (also known as sorted sets) given aRedisSerializationContext
.reactor.core.publisher.Mono<Boolean>
Remove the expiration from givenkey
.protected <T> org.reactivestreams.Publisher<T>
postProcessResult
(org.reactivestreams.Publisher<T> result, ReactiveRedisConnection connection, boolean existingConnection) Processes the result before returning thePublisher
.protected ReactiveRedisConnection
preProcessConnection
(ReactiveRedisConnection connection, boolean existingConnection) Processes the connection (before any settings are executed on it).reactor.core.publisher.Mono<K>
Return a random key from the keyspace.reactor.core.publisher.Mono<Boolean>
Rename keyoldKey
tonewKey
.reactor.core.publisher.Mono<Boolean>
renameIfAbsent
(K oldKey, K newKey) Rename keyoldKey
tonewKey
only ifnewKey
does not exist.reactor.core.publisher.Flux<K>
scan
(ScanOptions options) Use aFlux
to iterate over keys.reactor.core.publisher.Mono<DataType>
Determine the type stored atkey
.final reactor.core.publisher.Mono<Long>
Unlink thekey
from the keyspace.reactor.core.publisher.Mono<Long>
Unlink thekeys
from the keyspace.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.data.redis.core.ReactiveRedisOperations
execute, execute, listenToChannel, listenToChannelLater, listenToPattern, listenToPatternLater, scan
-
Constructor Details
-
ReactiveRedisTemplate
public ReactiveRedisTemplate(ReactiveRedisConnectionFactory connectionFactory, RedisSerializationContext<K, V> serializationContext) Creates newReactiveRedisTemplate
using givenReactiveRedisConnectionFactory
andRedisSerializationContext
.- Parameters:
connectionFactory
- must not be null.serializationContext
- must not be null.
-
ReactiveRedisTemplate
public ReactiveRedisTemplate(ReactiveRedisConnectionFactory connectionFactory, RedisSerializationContext<K, V> serializationContext, boolean exposeConnection) Creates newReactiveRedisTemplate
using givenReactiveRedisConnectionFactory
andRedisSerializationContext
.- Parameters:
connectionFactory
- must not be null.serializationContext
- must not be null.exposeConnection
- flag indicating to expose the connection used.
-
-
Method Details
-
getConnectionFactory
Returns the connectionFactory.- Returns:
- Returns the connectionFactory
-
execute
Description copied from interface:ReactiveRedisOperations
Executes the given action within a Redis connection. Application exceptions thrown by the action object get propagated to the caller (can only be unchecked) whenever possible. Redis exceptions are transformed into appropriate DAO ones. Allows for returning a result object, that is a domain object or a collection of domain objects. Performs automatic serialization/deserialization for the given objects to and from binary data suitable for the Redis storage. Note: Callback code is not supposed to handle transactions itself! Use an appropriate transaction manager. Generally, callback code must not touch any Connection lifecycle methods, like close, to let the template do its work.- Specified by:
execute
in interfaceReactiveRedisOperations<K,
V> - Type Parameters:
T
- return type- Parameters:
action
- callback object that specifies the Redis action- Returns:
- a result object returned by the action or
Flux.empty()
.
-
execute
public <T> reactor.core.publisher.Flux<T> execute(ReactiveRedisCallback<T> action, boolean exposeConnection) Executes the given action object within a connection that can be exposed or not. Additionally, the connection can be pipelined. Note the results of the pipeline are discarded (making it suitable for write-only scenarios).- Type Parameters:
T
- return type- Parameters:
action
- callback object to executeexposeConnection
- whether to enforce exposure of the native Redis Connection to callback code- Returns:
- object returned by the action
-
executeInSession
public <T> reactor.core.publisher.Flux<T> executeInSession(ReactiveRedisSessionCallback<K, V, T> action) Description copied from interface:ReactiveRedisOperations
Executes the given action within a Redis session using the sameReactiveRedisConnection
. Application exceptions thrown by the action object get propagated to the caller (can only be unchecked) whenever possible. Redis exceptions are transformed into appropriate DAO ones. Allows for returning a result object, that is a domain object or a collection of domain objects. Performs automatic serialization/deserialization for the given objects to and from binary data suitable for the Redis storage. Note: Callback code is not supposed to handle transactions itself! Use an appropriate transaction manager. Generally, callback code must not touch any Connection lifecycle methods, like close, to let the template do its work.- Specified by:
executeInSession
in interfaceReactiveRedisOperations<K,
V> - Type Parameters:
T
- return type- Parameters:
action
- callback object that specifies the Redis action- Returns:
- a result object returned by the action or
Flux.empty()
.
-
createFlux
Create a reusable Flux for aReactiveRedisCallback
. Callback is executed within a connection context. The connection is released outside the callback.- Parameters:
callback
- must not be null- Returns:
- a
Flux
wrapping theReactiveRedisCallback
.
-
createMono
Create a reusable Mono for aReactiveRedisCallback
. Callback is executed within a connection context. The connection is released outside the callback.- Parameters:
callback
- must not be null- Returns:
- a
Mono
wrapping theReactiveRedisCallback
.
-
getConnection
Creates aMono
which emits a newReactiveRedisConnection
. Can be overridden in subclasses to provide a different mechanism for connection allocation for the given method.- Since:
- 2.5.5
-
convertAndSend
Description copied from interface:ReactiveRedisOperations
Publishes the given message to the given channel.- Specified by:
convertAndSend
in interfaceReactiveRedisOperations<K,
V> - Parameters:
destination
- the channel to publish to, must not be null nor empty.message
- message to publish. Must not be null.- Returns:
- the number of clients that received the message
- See Also:
-
listenTo
public reactor.core.publisher.Flux<? extends ReactiveSubscription.Message<String,V>> listenTo(Topic... topics) Description copied from interface:ReactiveRedisOperations
Subscribe to the Redis channels for the giventopics
and emitmessages
received for those.Note that this method allocates a new
ReactiveRedisMessageListenerContainer
and uses a dedicated connection, similar to other methods on this interface. Invoking this method multiple times is an indication that you should useReactiveRedisMessageListenerContainer
directly.- Specified by:
listenTo
in interfaceReactiveRedisOperations<K,
V> - Parameters:
topics
- must not be null.- Returns:
- a hot sequence of
messages
. - See Also:
-
listenToLater
public reactor.core.publisher.Mono<reactor.core.publisher.Flux<? extends ReactiveSubscription.Message<String,V>>> listenToLater(Topic... topics) Description copied from interface:ReactiveRedisOperations
Subscribe to the Redis channels for the giventopics
and emitmessages
received for those. TheMono
completes once thetopic
subscriptions are registered.Note that this method allocates a new
ReactiveRedisMessageListenerContainer
and uses a dedicated connection, similar to other methods on this interface. Invoking this method multiple times is an indication that you should useReactiveRedisMessageListenerContainer
directly.- Specified by:
listenToLater
in interfaceReactiveRedisOperations<K,
V> - Parameters:
topics
- must not be null.- Returns:
- a hot sequence of
messages
. - See Also:
-
copy
Description copied from interface:ReactiveRedisOperations
Copy givensourceKey
totargetKey
.- Specified by:
copy
in interfaceReactiveRedisOperations<K,
V> - Parameters:
sourceKey
- must not be null.targetKey
- must not be null.- Returns:
- See Also:
-
hasKey
Description copied from interface:ReactiveRedisOperations
Determine if givenkey
exists.- Specified by:
hasKey
in interfaceReactiveRedisOperations<K,
V> - Parameters:
key
- must not be null.- Returns:
- See Also:
-
type
Description copied from interface:ReactiveRedisOperations
Determine the type stored atkey
.- Specified by:
type
in interfaceReactiveRedisOperations<K,
V> - Parameters:
key
- must not be null.- Returns:
- See Also:
-
keys
Description copied from interface:ReactiveRedisOperations
Find all keys matching the givenpattern
.
IMPORTANT: It is recommended to useReactiveRedisOperations.scan()
to iterate over the keyspace asReactiveRedisOperations.keys(Object)
is a non-interruptible and expensive Redis operation.- Specified by:
keys
in interfaceReactiveRedisOperations<K,
V> - Parameters:
pattern
- must not be null.- Returns:
- the
Flux
emitting matching keys one by one. - See Also:
-
scan
Description copied from interface:ReactiveRedisOperations
Use aFlux
to iterate over keys. The resultingFlux
acts as a cursor and issuesSCAN
commands itself as long as the subscriber signals demand.- Specified by:
scan
in interfaceReactiveRedisOperations<K,
V> - Parameters:
options
- must not be null. UseScanOptions.NONE
instead.- Returns:
- the
Flux
emitting the keys one by one or anempty flux
if none exist. - See Also:
-
randomKey
Description copied from interface:ReactiveRedisOperations
Return a random key from the keyspace.- Specified by:
randomKey
in interfaceReactiveRedisOperations<K,
V> - Returns:
- See Also:
-
rename
Description copied from interface:ReactiveRedisOperations
Rename keyoldKey
tonewKey
.- Specified by:
rename
in interfaceReactiveRedisOperations<K,
V> - Parameters:
oldKey
- must not be null.newKey
- must not be null.- See Also:
-
renameIfAbsent
Description copied from interface:ReactiveRedisOperations
Rename keyoldKey
tonewKey
only ifnewKey
does not exist.- Specified by:
renameIfAbsent
in interfaceReactiveRedisOperations<K,
V> - Parameters:
oldKey
- must not be null.newKey
- must not be null.- Returns:
- See Also:
-
delete
Description copied from interface:ReactiveRedisOperations
Delete givenkey
.- Specified by:
delete
in interfaceReactiveRedisOperations<K,
V> - Parameters:
keys
- must not be null.- Returns:
- The number of keys that were removed.
- See Also:
-
delete
Description copied from interface:ReactiveRedisOperations
Delete givenkeys
. This command buffers keys received fromPublisher
into chunks of 128 keys to delete to reduce the number of issuedDEL
commands.- Specified by:
delete
in interfaceReactiveRedisOperations<K,
V> - Parameters:
keys
- must not be null.- Returns:
- The number of keys that were removed.
- See Also:
-
unlink
Description copied from interface:ReactiveRedisOperations
Unlink thekey
from the keyspace. Unlike withReactiveRedisOperations.delete(Object[])
the actual memory reclaiming here happens asynchronously.- Specified by:
unlink
in interfaceReactiveRedisOperations<K,
V> - Parameters:
keys
- must not be null.- Returns:
- The number of keys that were removed. null when used in pipeline / transaction.
- See Also:
-
unlink
Description copied from interface:ReactiveRedisOperations
Unlink thekeys
from the keyspace. Unlike withReactiveRedisOperations.delete(Publisher)
the actual memory reclaiming here happens asynchronously. This command buffers keys received fromPublisher
into chunks of 128 keys to delete to reduce the number of issuedUNLINK
commands.- Specified by:
unlink
in interfaceReactiveRedisOperations<K,
V> - Parameters:
keys
- must not be null.- Returns:
- The number of keys that were removed. null when used in pipeline / transaction.
- See Also:
-
expire
Description copied from interface:ReactiveRedisOperations
Set time to live for givenkey
.- Specified by:
expire
in interfaceReactiveRedisOperations<K,
V> - Parameters:
key
- must not be null.timeout
- must not be null.- Returns:
-
expireAt
Description copied from interface:ReactiveRedisOperations
Set the expiration for givenkey
as a expireAt timestamp.- Specified by:
expireAt
in interfaceReactiveRedisOperations<K,
V> - Parameters:
key
- must not be null.expireAt
- must not be null.- Returns:
-
persist
Description copied from interface:ReactiveRedisOperations
Remove the expiration from givenkey
.- Specified by:
persist
in interfaceReactiveRedisOperations<K,
V> - Parameters:
key
- must not be null.- Returns:
- See Also:
-
getExpire
Description copied from interface:ReactiveRedisOperations
Get the time to live forkey
.- Specified by:
getExpire
in interfaceReactiveRedisOperations<K,
V> - Parameters:
key
- must not be null.- Returns:
- the
Duration
of the associated key.Duration.ZERO
if no timeout associated or emptyMono
if the key does not exist. - See Also:
-
move
Description copied from interface:ReactiveRedisOperations
Move givenkey
to database withindex
.- Specified by:
move
in interfaceReactiveRedisOperations<K,
V> - Parameters:
key
- must not be null.- Returns:
- See Also:
-
execute
public <T> reactor.core.publisher.Flux<T> execute(RedisScript<T> script, List<K> keys, List<?> args) Description copied from interface:ReactiveRedisOperations
Executes the givenRedisScript
- Specified by:
execute
in interfaceReactiveRedisOperations<K,
V> - Parameters:
script
- The script to execute. Must not be null.keys
- keys that need to be passed to the script. Must not be null.args
- args that need to be passed to the script. Must not be null.- Returns:
- result value of the script
Flux.empty()
ifRedisScript.getResultType()
is null, likely indicating a throw-away status reply (i.e. "OK").
-
execute
public <T> reactor.core.publisher.Flux<T> execute(RedisScript<T> script, List<K> keys, List<?> args, RedisElementWriter<?> argsWriter, RedisElementReader<T> resultReader) Description copied from interface:ReactiveRedisOperations
Executes the givenRedisScript
, using the providedRedisSerializer
s to serialize the script arguments and result.- Specified by:
execute
in interfaceReactiveRedisOperations<K,
V> - Parameters:
script
- The script to executekeys
- keys that need to be passed to the script.args
- args that need to be passed to the script.argsWriter
- TheRedisElementWriter
to use for serializing argsresultReader
- TheRedisElementReader
to use for serializing the script return value- Returns:
- result value of the script
Flux.empty()
ifRedisScript.getResultType()
is null, likely indicating a throw-away status reply (i.e. "OK").
-
preProcessConnection
protected ReactiveRedisConnection preProcessConnection(ReactiveRedisConnection connection, boolean existingConnection) Processes the connection (before any settings are executed on it). Default implementation returns the connection as is.- Parameters:
connection
- must not be null.existingConnection
-
-
postProcessResult
protected <T> org.reactivestreams.Publisher<T> postProcessResult(org.reactivestreams.Publisher<T> result, ReactiveRedisConnection connection, boolean existingConnection) Processes the result before returning thePublisher
. Default implementation returns the result as is.- Parameters:
result
- must not be null.connection
- must not be null.existingConnection
-- Returns:
-
createRedisConnectionProxy
protected ReactiveRedisConnection createRedisConnectionProxy(ReactiveRedisConnection reactiveRedisConnection) -
opsForGeo
Description copied from interface:ReactiveRedisOperations
Returns geospatial specific operations interface.- Specified by:
opsForGeo
in interfaceReactiveRedisOperations<K,
V> - Returns:
- geospatial specific operations.
-
opsForGeo
public <K1,V1> ReactiveGeoOperations<K1,V1> opsForGeo(RedisSerializationContext<K1, V1> serializationContext) Description copied from interface:ReactiveRedisOperations
Returns geospatial specific operations interface.- Specified by:
opsForGeo
in interfaceReactiveRedisOperations<K,
V> - Parameters:
serializationContext
- serializers to be used with the returned operations, must not be null.- Returns:
- geospatial specific operations.
-
opsForHash
Description copied from interface:ReactiveRedisOperations
Returns the operations performed on hash values.- Specified by:
opsForHash
in interfaceReactiveRedisOperations<K,
V> - Type Parameters:
HK
- hash key (or field) type.HV
- hash value type.- Returns:
- hash operations.
-
opsForHash
public <K1,HK, ReactiveHashOperations<K1,HV> HK, opsForHashHV> (RedisSerializationContext<K1, ?> serializationContext) Description copied from interface:ReactiveRedisOperations
Returns the operations performed on hash values given aRedisSerializationContext
.- Specified by:
opsForHash
in interfaceReactiveRedisOperations<K,
V> HK
- hash key (or field) type.HV
- hash value type.- Parameters:
serializationContext
- serializers to be used with the returned operations, must not be null.- Returns:
- hash operations.
-
opsForHyperLogLog
Description copied from interface:ReactiveRedisOperations
Returns the operations performed on multisets using HyperLogLog.- Specified by:
opsForHyperLogLog
in interfaceReactiveRedisOperations<K,
V> - Returns:
- never null.
-
opsForHyperLogLog
public <K1,V1> ReactiveHyperLogLogOperations<K1,V1> opsForHyperLogLog(RedisSerializationContext<K1, V1> serializationContext) Description copied from interface:ReactiveRedisOperations
Returns the operations performed on multisets using HyperLogLog given aRedisSerializationContext
.- Specified by:
opsForHyperLogLog
in interfaceReactiveRedisOperations<K,
V> - Parameters:
serializationContext
- serializers to be used with the returned operations, must not be null.- Returns:
- never null.
-
opsForList
Description copied from interface:ReactiveRedisOperations
Returns the operations performed on list values.- Specified by:
opsForList
in interfaceReactiveRedisOperations<K,
V> - Returns:
- list operations.
-
opsForList
public <K1,V1> ReactiveListOperations<K1,V1> opsForList(RedisSerializationContext<K1, V1> serializationContext) Description copied from interface:ReactiveRedisOperations
Returns the operations performed on list values given aRedisSerializationContext
.- Specified by:
opsForList
in interfaceReactiveRedisOperations<K,
V> - Parameters:
serializationContext
- serializers to be used with the returned operations, must not be null.- Returns:
- list operations.
-
opsForSet
Description copied from interface:ReactiveRedisOperations
Returns the operations performed on set values.- Specified by:
opsForSet
in interfaceReactiveRedisOperations<K,
V> - Returns:
- set operations.
-
opsForSet
public <K1,V1> ReactiveSetOperations<K1,V1> opsForSet(RedisSerializationContext<K1, V1> serializationContext) Description copied from interface:ReactiveRedisOperations
Returns the operations performed on set values given aRedisSerializationContext
.- Specified by:
opsForSet
in interfaceReactiveRedisOperations<K,
V> - Parameters:
serializationContext
- serializers to be used with the returned operations, must not be null.- Returns:
- set operations.
-
opsForStream
Description copied from interface:ReactiveRedisOperations
Returns the operations performed on streams.- Specified by:
opsForStream
in interfaceReactiveRedisOperations<K,
V> - Returns:
- stream operations.
-
opsForStream
public <HK,HV> ReactiveStreamOperations<K,HK, opsForStreamHV> (HashMapper<? super K, ? super HK, ? super HV> hashMapper) Description copied from interface:ReactiveRedisOperations
Returns the operations performed on streams.- Specified by:
opsForStream
in interfaceReactiveRedisOperations<K,
V> - Parameters:
hashMapper
- theHashMapper
to use when mapping complex objects.- Returns:
- stream operations.
-
opsForStream
public <HK,HV> ReactiveStreamOperations<K,HK, opsForStreamHV> (RedisSerializationContext<K, ?> serializationContext) Description copied from interface:ReactiveRedisOperations
Returns the operations performed on streams given aRedisSerializationContext
.- Specified by:
opsForStream
in interfaceReactiveRedisOperations<K,
V> - Parameters:
serializationContext
- serializers to be used with the returned operations, must not be null.- Returns:
- stream operations.
-
opsForStream
protected <HK,HV> ReactiveStreamOperations<K,HK, opsForStreamHV> (RedisSerializationContext<K, ?> serializationContext, @Nullable HashMapper<? super K, ? super HK, ? super HV> hashMapper) -
opsForValue
Description copied from interface:ReactiveRedisOperations
Returns the operations performed on simple values (or Strings in Redis terminology).- Specified by:
opsForValue
in interfaceReactiveRedisOperations<K,
V> - Returns:
- value operations
-
opsForValue
public <K1,V1> ReactiveValueOperations<K1,V1> opsForValue(RedisSerializationContext<K1, V1> serializationContext) Description copied from interface:ReactiveRedisOperations
Returns the operations performed on simple values (or Strings in Redis terminology) given aRedisSerializationContext
.- Specified by:
opsForValue
in interfaceReactiveRedisOperations<K,
V> - Parameters:
serializationContext
- serializers to be used with the returned operations, must not be null.- Returns:
- value operations.
-
opsForZSet
Description copied from interface:ReactiveRedisOperations
Returns the operations performed on zset values (also known as sorted sets).- Specified by:
opsForZSet
in interfaceReactiveRedisOperations<K,
V> - Returns:
- zset operations.
-
opsForZSet
public <K1,V1> ReactiveZSetOperations<K1,V1> opsForZSet(RedisSerializationContext<K1, V1> serializationContext) Description copied from interface:ReactiveRedisOperations
Returns the operations performed on zset values (also known as sorted sets) given aRedisSerializationContext
.- Specified by:
opsForZSet
in interfaceReactiveRedisOperations<K,
V> - Parameters:
serializationContext
- serializers to be used with the returned operations, must not be null.- Returns:
- zset operations.
-
getSerializationContext
- Specified by:
getSerializationContext
in interfaceReactiveRedisOperations<K,
V> - Returns:
- the
RedisSerializationContext
.
-