Package io.lettuce.core.api.async
Interface RedisStreamAsyncCommands<K,V>
-
- Type Parameters:
K
- Key type.V
- Value type.
- All Known Subinterfaces:
RedisAdvancedClusterAsyncCommands<K,V>
,RedisAsyncCommands<K,V>
,RedisClusterAsyncCommands<K,V>
,RedisClusterPubSubAsyncCommands<K,V>
,RedisPubSubAsyncCommands<K,V>
- All Known Implementing Classes:
AbstractRedisAsyncCommands
,RedisAdvancedClusterAsyncCommandsImpl
,RedisAsyncCommandsImpl
,RedisClusterPubSubAsyncCommandsImpl
,RedisPubSubAsyncCommandsImpl
public interface RedisStreamAsyncCommands<K,V>
Asynchronous executed commands for Streams.- Since:
- 5.1
- Author:
- Mark Paluch
- Generated class:
- by io.lettuce.apigenerator.CreateAsyncApi
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RedisFuture<Long>
xack(K key, K group, String... messageIds)
Acknowledge one or more messages as processed.RedisFuture<String>
xadd(K key, XAddArgs args, Object... keysAndValues)
Append a message to the streamkey
.RedisFuture<String>
xadd(K key, XAddArgs args, Map<K,V> body)
Append a message to the streamkey
.RedisFuture<String>
xadd(K key, Object... keysAndValues)
Append a message to the streamkey
.RedisFuture<String>
xadd(K key, Map<K,V> body)
Append a message to the streamkey
.RedisFuture<ClaimedMessages<K,V>>
xautoclaim(K key, XAutoClaimArgs<K> args)
Gets ownership of one or multiple messages in the Pending Entries List of a given stream consumer group.RedisFuture<List<StreamMessage<K,V>>>
xclaim(K key, Consumer<K> consumer, long minIdleTime, String... messageIds)
Gets ownership of one or multiple messages in the Pending Entries List of a given stream consumer group.RedisFuture<List<StreamMessage<K,V>>>
xclaim(K key, Consumer<K> consumer, XClaimArgs args, String... messageIds)
Gets ownership of one or multiple messages in the Pending Entries List of a given stream consumer group.RedisFuture<Long>
xdel(K key, String... messageIds)
Removes the specified entries from the stream.RedisFuture<String>
xgroupCreate(XReadArgs.StreamOffset<K> streamOffset, K group)
Create a consumer group.RedisFuture<String>
xgroupCreate(XReadArgs.StreamOffset<K> streamOffset, K group, XGroupCreateArgs args)
Create a consumer group.RedisFuture<Boolean>
xgroupCreateconsumer(K key, Consumer<K> consumer)
Create a consumer from a consumer group.RedisFuture<Long>
xgroupDelconsumer(K key, Consumer<K> consumer)
Delete a consumer from a consumer group.RedisFuture<Boolean>
xgroupDestroy(K key, K group)
Destroy a consumer group.RedisFuture<String>
xgroupSetid(XReadArgs.StreamOffset<K> streamOffset, K group)
Set the currentgroup
id.RedisFuture<List<Object>>
xinfoConsumers(K key, K group)
Retrieve information about consumer groups of groupgroup
and stream atkey
.RedisFuture<List<Object>>
xinfoGroups(K key)
Retrieve information about the stream consumer groups atkey
.RedisFuture<List<Object>>
xinfoStream(K key)
Retrieve information about the stream atkey
.RedisFuture<Long>
xlen(K key)
Get the length of a steam.RedisFuture<List<PendingMessage>>
xpending(K key, Consumer<K> consumer, Range<String> range, Limit limit)
Read pending messages from a stream within a specificRange
.RedisFuture<List<PendingMessage>>
xpending(K key, XPendingArgs<K> args)
Read pending messages from a stream within a specificXPendingArgs
.RedisFuture<PendingMessages>
xpending(K key, K group)
Read pending messages from a stream for agroup
.RedisFuture<List<PendingMessage>>
xpending(K key, K group, Range<String> range, Limit limit)
Read pending messages from a stream within a specificRange
.RedisFuture<List<StreamMessage<K,V>>>
xrange(K key, Range<String> range)
Read messages from a stream within a specificRange
.RedisFuture<List<StreamMessage<K,V>>>
xrange(K key, Range<String> range, Limit limit)
RedisFuture<List<StreamMessage<K,V>>>
xread(XReadArgs.StreamOffset<K>... streams)
Read messages from one or moreXReadArgs.StreamOffset
s.RedisFuture<List<StreamMessage<K,V>>>
xread(XReadArgs args, XReadArgs.StreamOffset<K>... streams)
Read messages from one or moreXReadArgs.StreamOffset
s.RedisFuture<List<StreamMessage<K,V>>>
xreadgroup(Consumer<K> consumer, XReadArgs.StreamOffset<K>... streams)
Read messages from one or moreXReadArgs.StreamOffset
s using a consumer group.RedisFuture<List<StreamMessage<K,V>>>
xreadgroup(Consumer<K> consumer, XReadArgs args, XReadArgs.StreamOffset<K>... streams)
Read messages from one or moreXReadArgs.StreamOffset
s using a consumer group.RedisFuture<List<StreamMessage<K,V>>>
xrevrange(K key, Range<String> range)
Read messages from a stream within a specificRange
in reverse order.RedisFuture<List<StreamMessage<K,V>>>
xrevrange(K key, Range<String> range, Limit limit)
RedisFuture<Long>
xtrim(K key, boolean approximateTrimming, long count)
Trims the stream tocount
elements.RedisFuture<Long>
xtrim(K key, long count)
Trims the stream tocount
elements.RedisFuture<Long>
xtrim(K key, XTrimArgs args)
Trims the stream within a specificXTrimArgs
.
-
-
-
Method Detail
-
xack
RedisFuture<Long> xack(K key, K group, String... messageIds)
Acknowledge one or more messages as processed.- Parameters:
key
- the stream key.group
- name of the consumer group.messageIds
- message Id's to acknowledge.- Returns:
- simple-reply the lenght of acknowledged messages.
-
xadd
RedisFuture<String> xadd(K key, Map<K,V> body)
Append a message to the streamkey
.- Parameters:
key
- the stream key.body
- message body.- Returns:
- simple-reply the message Id.
-
xadd
RedisFuture<String> xadd(K key, XAddArgs args, Map<K,V> body)
Append a message to the streamkey
.- Parameters:
key
- the stream key.args
-body
- message body.- Returns:
- simple-reply the message Id.
-
xadd
RedisFuture<String> xadd(K key, Object... keysAndValues)
Append a message to the streamkey
.- Parameters:
key
- the stream key.keysAndValues
- message body.- Returns:
- simple-reply the message Id.
-
xadd
RedisFuture<String> xadd(K key, XAddArgs args, Object... keysAndValues)
Append a message to the streamkey
.- Parameters:
key
- the stream key.args
-keysAndValues
- message body.- Returns:
- simple-reply the message Id.
-
xautoclaim
RedisFuture<ClaimedMessages<K,V>> xautoclaim(K key, XAutoClaimArgs<K> args)
Gets ownership of one or multiple messages in the Pending Entries List of a given stream consumer group.- Parameters:
key
- the stream key.args
-- Returns:
- simple-reply the claimed stream messages.
- Since:
- 6.1
-
xclaim
RedisFuture<List<StreamMessage<K,V>>> xclaim(K key, Consumer<K> consumer, long minIdleTime, String... messageIds)
Gets ownership of one or multiple messages in the Pending Entries List of a given stream consumer group.- Parameters:
key
- the stream key.consumer
- consumer identified by group name and consumer key.minIdleTime
-messageIds
- message Id's to claim.- Returns:
- simple-reply the
StreamMessage
.
-
xclaim
RedisFuture<List<StreamMessage<K,V>>> xclaim(K key, Consumer<K> consumer, XClaimArgs args, String... messageIds)
Gets ownership of one or multiple messages in the Pending Entries List of a given stream consumer group.Note that setting the
JUSTID
flag (calling this method withXClaimArgs.justid()
) suppresses the message bode andStreamMessage.getBody()
isnull
.- Parameters:
key
- the stream key.consumer
- consumer identified by group name and consumer key.args
-messageIds
- message Id's to claim.- Returns:
- simple-reply the
StreamMessage
.
-
xdel
RedisFuture<Long> xdel(K key, String... messageIds)
Removes the specified entries from the stream. Returns the number of items deleted, that may be different from the number of IDs passed in case certain IDs do not exist.- Parameters:
key
- the stream key.messageIds
- stream message Id's.- Returns:
- simple-reply number of removed entries.
-
xgroupCreate
RedisFuture<String> xgroupCreate(XReadArgs.StreamOffset<K> streamOffset, K group)
Create a consumer group.- Parameters:
streamOffset
- name of the stream containing the offset to set.group
- name of the consumer group.- Returns:
- simple-reply
true
if successful.
-
xgroupCreate
RedisFuture<String> xgroupCreate(XReadArgs.StreamOffset<K> streamOffset, K group, XGroupCreateArgs args)
Create a consumer group.- Parameters:
streamOffset
- name of the stream containing the offset to set.group
- name of the consumer group.args
-- Returns:
- simple-reply
true
if successful. - Since:
- 5.2
-
xgroupCreateconsumer
RedisFuture<Boolean> xgroupCreateconsumer(K key, Consumer<K> consumer)
Create a consumer from a consumer group.- Parameters:
key
- the stream key.consumer
- consumer identified by group name and consumer key.- Returns:
- simple-reply
true
if successful. - Since:
- 6.1
-
xgroupDelconsumer
RedisFuture<Long> xgroupDelconsumer(K key, Consumer<K> consumer)
Delete a consumer from a consumer group.- Parameters:
key
- the stream key.consumer
- consumer identified by group name and consumer key.- Returns:
- Long integer-reply number of pending messages.
-
xgroupDestroy
RedisFuture<Boolean> xgroupDestroy(K key, K group)
Destroy a consumer group.- Parameters:
key
- the stream key.group
- name of the consumer group.- Returns:
- simple-reply
true
if successful.
-
xgroupSetid
RedisFuture<String> xgroupSetid(XReadArgs.StreamOffset<K> streamOffset, K group)
Set the currentgroup
id.- Parameters:
streamOffset
- name of the stream containing the offset to set.group
- name of the consumer group.- Returns:
- simple-reply OK.
-
xinfoStream
RedisFuture<List<Object>> xinfoStream(K key)
Retrieve information about the stream atkey
.- Parameters:
key
- the stream key.- Returns:
- List<Object> array-reply.
- Since:
- 5.2
-
xinfoGroups
RedisFuture<List<Object>> xinfoGroups(K key)
Retrieve information about the stream consumer groups atkey
.- Parameters:
key
- the stream key.- Returns:
- List<Object> array-reply.
- Since:
- 5.2
-
xinfoConsumers
RedisFuture<List<Object>> xinfoConsumers(K key, K group)
Retrieve information about consumer groups of groupgroup
and stream atkey
.- Parameters:
key
- the stream key.group
- name of the consumer group.- Returns:
- List<Object> array-reply.
- Since:
- 5.2
-
xlen
RedisFuture<Long> xlen(K key)
Get the length of a steam.- Parameters:
key
- the stream key.- Returns:
- simple-reply the lenght of the stream.
-
xpending
RedisFuture<PendingMessages> xpending(K key, K group)
Read pending messages from a stream for agroup
.- Parameters:
key
- the stream key.group
- name of the consumer group.- Returns:
- List<Object> array-reply list pending entries.
-
xpending
RedisFuture<List<PendingMessage>> xpending(K key, K group, Range<String> range, Limit limit)
Read pending messages from a stream within a specificRange
.- Parameters:
key
- the stream key.group
- name of the consumer group.range
- must not benull
.limit
- must not benull
.- Returns:
- List<Object> array-reply list with members of the resulting stream.
-
xpending
RedisFuture<List<PendingMessage>> xpending(K key, Consumer<K> consumer, Range<String> range, Limit limit)
Read pending messages from a stream within a specificRange
.- Parameters:
key
- the stream key.consumer
- consumer identified by group name and consumer key.range
- must not benull
.limit
- must not benull
.- Returns:
- List<Object> array-reply list with members of the resulting stream.
-
xpending
RedisFuture<List<PendingMessage>> xpending(K key, XPendingArgs<K> args)
Read pending messages from a stream within a specificXPendingArgs
.- Parameters:
key
- the stream key.args
-- Returns:
- List<Object> array-reply list with members of the resulting stream.
- Since:
- 6.1
-
xrange
RedisFuture<List<StreamMessage<K,V>>> xrange(K key, Range<String> range)
Read messages from a stream within a specificRange
.- Parameters:
key
- the stream key.range
- must not benull
.- Returns:
- List<StreamMessage> array-reply list with members of the resulting stream.
-
xrange
RedisFuture<List<StreamMessage<K,V>>> xrange(K key, Range<String> range, Limit limit)
- Parameters:
key
- the stream key.range
- must not benull
.limit
- must not benull
.- Returns:
- List<StreamMessage> array-reply list with members of the resulting stream.
-
xread
RedisFuture<List<StreamMessage<K,V>>> xread(XReadArgs.StreamOffset<K>... streams)
Read messages from one or moreXReadArgs.StreamOffset
s.- Parameters:
streams
- the streams to read from.- Returns:
- List<StreamMessage> array-reply list with members of the resulting stream.
-
xread
RedisFuture<List<StreamMessage<K,V>>> xread(XReadArgs args, XReadArgs.StreamOffset<K>... streams)
Read messages from one or moreXReadArgs.StreamOffset
s.- Parameters:
args
- read arguments.streams
- the streams to read from.- Returns:
- List<StreamMessage> array-reply list with members of the resulting stream.
-
xreadgroup
RedisFuture<List<StreamMessage<K,V>>> xreadgroup(Consumer<K> consumer, XReadArgs.StreamOffset<K>... streams)
Read messages from one or moreXReadArgs.StreamOffset
s using a consumer group.- Parameters:
consumer
- consumer/group.streams
- the streams to read from.- Returns:
- List<StreamMessage> array-reply list with members of the resulting stream.
-
xreadgroup
RedisFuture<List<StreamMessage<K,V>>> xreadgroup(Consumer<K> consumer, XReadArgs args, XReadArgs.StreamOffset<K>... streams)
Read messages from one or moreXReadArgs.StreamOffset
s using a consumer group.- Parameters:
consumer
- consumer/group.args
- read arguments.streams
- the streams to read from.- Returns:
- List<StreamMessage> array-reply list with members of the resulting stream.
-
xrevrange
RedisFuture<List<StreamMessage<K,V>>> xrevrange(K key, Range<String> range)
Read messages from a stream within a specificRange
in reverse order.- Parameters:
key
- the stream key.range
- must not benull
.- Returns:
- List<StreamMessage> array-reply list with members of the resulting stream.
-
xrevrange
RedisFuture<List<StreamMessage<K,V>>> xrevrange(K key, Range<String> range, Limit limit)
- Parameters:
key
- the stream key.range
- must not benull
.limit
- must not benull
.- Returns:
- List<StreamMessage> array-reply list with members of the resulting stream.
-
xtrim
RedisFuture<Long> xtrim(K key, long count)
Trims the stream tocount
elements.- Parameters:
key
- the stream key.count
- length of the stream.- Returns:
- simple-reply number of removed entries.
-
xtrim
RedisFuture<Long> xtrim(K key, boolean approximateTrimming, long count)
Trims the stream tocount
elements.- Parameters:
key
- the stream key.approximateTrimming
-true
to trim approximately using the~
flag.count
- length of the stream.- Returns:
- simple-reply number of removed entries.
-
xtrim
RedisFuture<Long> xtrim(K key, XTrimArgs args)
Trims the stream within a specificXTrimArgs
.- Parameters:
key
- the stream key.args
-- Returns:
- simple-reply number of removed entries.
- Since:
- 6.1
-
-