K
- Key type.V
- Value type.public interface RedisStreamAsyncCommands<K,V>
Modifier and Type | Method and Description |
---|---|
RedisFuture<Long> |
xack(K key,
K group,
String... messageIds)
Acknowledge one or more messages as processed.
|
RedisFuture<List<StreamEntryDeletionResult>> |
xackdel(K key,
K group,
StreamDeletionPolicy policy,
String... messageIds)
Acknowledge and delete one or more messages from the stream and consumer group with a specific deletion policy.
|
RedisFuture<List<StreamEntryDeletionResult>> |
xackdel(K key,
K group,
String... messageIds)
Acknowledge and delete one or more messages from the stream and consumer group.
|
RedisFuture<String> |
xadd(K key,
Map<K,V> body)
Append a message to the stream
key . |
RedisFuture<String> |
xadd(K key,
Object... keysAndValues)
Append a message to the stream
key . |
RedisFuture<String> |
xadd(K key,
XAddArgs args,
Map<K,V> body)
Append a message to the stream
key . |
RedisFuture<String> |
xadd(K key,
XAddArgs args,
Object... keysAndValues)
Append a message to the stream
key . |
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<List<StreamEntryDeletionResult>> |
xdelex(K key,
StreamDeletionPolicy policy,
String... messageIds)
Extended delete operation that removes the specified entries from the stream with a specific deletion policy and returns
detailed results for each message ID indicating whether it was deleted, not found, or not deleted due to acknowledgment
status.
|
RedisFuture<List<StreamEntryDeletionResult>> |
xdelex(K key,
String... messageIds)
Extended delete operation that removes the specified entries from the stream and returns detailed results for each
message ID indicating whether it was deleted, not found, or not deleted due to acknowledgment status.
|
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 current
group id. |
RedisFuture<List<Object>> |
xinfoConsumers(K key,
K group)
Retrieve information about consumer groups of group
group and stream at key . |
RedisFuture<List<Object>> |
xinfoGroups(K key)
Retrieve information about the stream consumer groups at
key . |
RedisFuture<List<Object>> |
xinfoStream(K key)
Retrieve information about the stream at
key . |
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 specific
Range . |
RedisFuture<PendingMessages> |
xpending(K key,
K group)
Read pending messages from a stream for a
group . |
RedisFuture<List<PendingMessage>> |
xpending(K key,
K group,
Range<String> range,
Limit limit)
Read pending messages from a stream within a specific
Range . |
RedisFuture<List<PendingMessage>> |
xpending(K key,
XPendingArgs<K> args)
Read pending messages from a stream within a specific
XPendingArgs . |
RedisFuture<List<StreamMessage<K,V>>> |
xrange(K key,
Range<String> range)
Read messages from a stream within a specific
Range . |
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 more
XReadArgs.StreamOffset s. |
RedisFuture<List<StreamMessage<K,V>>> |
xread(XReadArgs args,
XReadArgs.StreamOffset<K>... streams)
Read messages from one or more
XReadArgs.StreamOffset s. |
RedisFuture<List<StreamMessage<K,V>>> |
xreadgroup(Consumer<K> consumer,
XReadArgs.StreamOffset<K>... streams)
Read messages from one or more
XReadArgs.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 more
XReadArgs.StreamOffset s using a consumer group. |
RedisFuture<List<StreamMessage<K,V>>> |
xrevrange(K key,
Range<String> range)
Read messages from a stream within a specific
Range 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 to
count elements. |
RedisFuture<Long> |
xtrim(K key,
long count)
Trims the stream to
count elements. |
RedisFuture<Long> |
xtrim(K key,
XTrimArgs args)
Trims the stream within a specific
XTrimArgs . |
RedisFuture<Long> xack(K key, K group, String... messageIds)
key
- the stream key.group
- name of the consumer group.messageIds
- message Id's to acknowledge.RedisFuture<List<StreamEntryDeletionResult>> xackdel(K key, K group, String... messageIds)
key
- the stream key.group
- name of the consumer group.messageIds
- message Id's to acknowledge and delete.StreamEntryDeletionResult
indicating the result for each message ID.RedisFuture<List<StreamEntryDeletionResult>> xackdel(K key, K group, StreamDeletionPolicy policy, String... messageIds)
key
- the stream key.group
- name of the consumer group.policy
- the deletion policy to apply.messageIds
- message Id's to acknowledge and delete.StreamEntryDeletionResult
indicating the result for each message ID.RedisFuture<String> xadd(K key, Map<K,V> body)
key
.key
- the stream key.body
- message body.RedisFuture<String> xadd(K key, XAddArgs args, Map<K,V> body)
key
.key
- the stream key.args
- body
- message body.RedisFuture<String> xadd(K key, Object... keysAndValues)
key
.key
- the stream key.keysAndValues
- message body.RedisFuture<String> xadd(K key, XAddArgs args, Object... keysAndValues)
key
.key
- the stream key.args
- keysAndValues
- message body.RedisFuture<ClaimedMessages<K,V>> xautoclaim(K key, XAutoClaimArgs<K> args)
key
- the stream key.args
- RedisFuture<List<StreamMessage<K,V>>> xclaim(K key, Consumer<K> consumer, long minIdleTime, String... messageIds)
key
- the stream key.consumer
- consumer identified by group name and consumer key.minIdleTime
- messageIds
- message Id's to claim.StreamMessage
.RedisFuture<List<StreamMessage<K,V>>> xclaim(K key, Consumer<K> consumer, XClaimArgs args, String... messageIds)
Note that setting the JUSTID
flag (calling this method with XClaimArgs.justid()
) suppresses the message
bode and StreamMessage.getBody()
is null
.
key
- the stream key.consumer
- consumer identified by group name and consumer key.args
- messageIds
- message Id's to claim.StreamMessage
.RedisFuture<Long> xdel(K key, String... messageIds)
key
- the stream key.messageIds
- stream message Id's.RedisFuture<List<StreamEntryDeletionResult>> xdelex(K key, String... messageIds)
key
- the stream key.messageIds
- stream message Id's.StreamEntryDeletionResult
indicating the result for each message ID.RedisFuture<List<StreamEntryDeletionResult>> xdelex(K key, StreamDeletionPolicy policy, String... messageIds)
key
- the stream key.policy
- the deletion policy to apply.messageIds
- stream message Id's.StreamEntryDeletionResult
indicating the result for each message ID.RedisFuture<String> xgroupCreate(XReadArgs.StreamOffset<K> streamOffset, K group)
streamOffset
- name of the stream containing the offset to set.group
- name of the consumer group.true
if successful.RedisFuture<String> xgroupCreate(XReadArgs.StreamOffset<K> streamOffset, K group, XGroupCreateArgs args)
streamOffset
- name of the stream containing the offset to set.group
- name of the consumer group.args
- true
if successful.RedisFuture<Boolean> xgroupCreateconsumer(K key, Consumer<K> consumer)
key
- the stream key.consumer
- consumer identified by group name and consumer key.true
if successful.RedisFuture<Long> xgroupDelconsumer(K key, Consumer<K> consumer)
key
- the stream key.consumer
- consumer identified by group name and consumer key.RedisFuture<Boolean> xgroupDestroy(K key, K group)
key
- the stream key.group
- name of the consumer group.true
if successful.RedisFuture<String> xgroupSetid(XReadArgs.StreamOffset<K> streamOffset, K group)
group
id.streamOffset
- name of the stream containing the offset to set.group
- name of the consumer group.RedisFuture<List<Object>> xinfoStream(K key)
key
.key
- the stream key.RedisFuture<List<Object>> xinfoGroups(K key)
key
.key
- the stream key.RedisFuture<List<Object>> xinfoConsumers(K key, K group)
group
and stream at key
.key
- the stream key.group
- name of the consumer group.RedisFuture<Long> xlen(K key)
key
- the stream key.RedisFuture<PendingMessages> xpending(K key, K group)
group
.key
- the stream key.group
- name of the consumer group.RedisFuture<List<PendingMessage>> xpending(K key, K group, Range<String> range, Limit limit)
Range
.key
- the stream key.group
- name of the consumer group.range
- must not be null
.limit
- must not be null
.RedisFuture<List<PendingMessage>> xpending(K key, Consumer<K> consumer, Range<String> range, Limit limit)
Range
.key
- the stream key.consumer
- consumer identified by group name and consumer key.range
- must not be null
.limit
- must not be null
.RedisFuture<List<PendingMessage>> xpending(K key, XPendingArgs<K> args)
XPendingArgs
.key
- the stream key.args
- RedisFuture<List<StreamMessage<K,V>>> xrange(K key, Range<String> range)
Range
.key
- the stream key.range
- must not be null
.RedisFuture<List<StreamMessage<K,V>>> xrange(K key, Range<String> range, Limit limit)
key
- the stream key.range
- must not be null
.limit
- must not be null
.RedisFuture<List<StreamMessage<K,V>>> xread(XReadArgs.StreamOffset<K>... streams)
XReadArgs.StreamOffset
s.streams
- the streams to read from.RedisFuture<List<StreamMessage<K,V>>> xread(XReadArgs args, XReadArgs.StreamOffset<K>... streams)
XReadArgs.StreamOffset
s.args
- read arguments.streams
- the streams to read from.RedisFuture<List<StreamMessage<K,V>>> xreadgroup(Consumer<K> consumer, XReadArgs.StreamOffset<K>... streams)
XReadArgs.StreamOffset
s using a consumer group.consumer
- consumer/group.streams
- the streams to read from.RedisFuture<List<StreamMessage<K,V>>> xreadgroup(Consumer<K> consumer, XReadArgs args, XReadArgs.StreamOffset<K>... streams)
XReadArgs.StreamOffset
s using a consumer group.consumer
- consumer/group.args
- read arguments.streams
- the streams to read from.RedisFuture<List<StreamMessage<K,V>>> xrevrange(K key, Range<String> range)
Range
in reverse order.key
- the stream key.range
- must not be null
.RedisFuture<List<StreamMessage<K,V>>> xrevrange(K key, Range<String> range, Limit limit)
key
- the stream key.range
- must not be null
.limit
- must not be null
.RedisFuture<Long> xtrim(K key, long count)
count
elements.key
- the stream key.count
- length of the stream.RedisFuture<Long> xtrim(K key, boolean approximateTrimming, long count)
count
elements.key
- the stream key.approximateTrimming
- true
to trim approximately using the ~
flag.count
- length of the stream.RedisFuture<Long> xtrim(K key, XTrimArgs args)
XTrimArgs
.key
- the stream key.args
- Copyright © 2025 lettuce.io. All rights reserved.