Interface RStreamAsync<K,V>
- Type Parameters:
K
- key typeV
- value type
- All Superinterfaces:
RExpirableAsync
,RObjectAsync
- All Known Subinterfaces:
RStream<K,
V>
- All Known Implementing Classes:
RedissonStream
Requires Redis 5.0.0 and higher.
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptionackAsync
(String groupName, StreamMessageId... ids) Marks pending messages by group name and streamids
as correctly processed.addAsync
(StreamAddArgs<K, V> args) Appends a new entry/entries and returns generated Stream Message IDaddAsync
(StreamMessageId id, StreamAddArgs<K, V> args) Appends a new entry/entries by specified Stream Message IDaddListenerAsync
(ObjectListener listener) Adds object event listenerautoClaimAsync
(String groupName, String consumerName, long idleTime, TimeUnit idleTimeUnit, StreamMessageId startId, int count) Transfers ownership of pending messages by id to a new consumer by name if idle time of messages and startId are greater than defined value.claimAsync
(String groupName, String consumerName, long idleTime, TimeUnit idleTimeUnit, StreamMessageId... ids) Transfers ownership of pending messages by id to a new consumer by name if idle time of messages is greater than defined value.createConsumerAsync
(String groupName, String consumerName) Creates consumer of the group by name.Creates consumer group.fastAutoClaimAsync
(String groupName, String consumerName, long idleTime, TimeUnit idleTimeUnit, StreamMessageId startId, int count) Transfers ownership of pending messages by id to a new consumer by name if idle time of messages and startId are greater than defined value.fastClaimAsync
(String groupName, String consumerName, long idleTime, TimeUnit idleTimeUnit, StreamMessageId... ids) Transfers ownership of pending messages by id to a new consumer by name if idle time of messages is greater than defined value.RFuture
<StreamInfo<K, V>> Returns information about this stream.getPendingInfoAsync
(String groupName) Returns common info about pending messages by group name.listConsumersAsync
(String groupName) Returns list of objects with information about group customers for specifiedgroupName
.Returns list of objects with information about groups belonging to this stream.listPendingAsync
(String groupName, String consumerName, StreamMessageId startId, StreamMessageId endId, int count) Returns list of common info about pending messages by group and consumer name.listPendingAsync
(String groupName, String consumerName, StreamMessageId startId, StreamMessageId endId, long idleTime, TimeUnit idleTimeUnit, int count) Returns list of common info about pending messages by group and consumer name.listPendingAsync
(String groupName, StreamMessageId startId, StreamMessageId endId, int count) Returns list of common info about pending messages by group name.listPendingAsync
(String groupName, StreamMessageId startId, StreamMessageId endId, long idleTime, TimeUnit idleTimeUnit, int count) Returns list of common info about pending messages by group name.pendingRangeAsync
(String groupName, String consumerName, StreamMessageId startId, StreamMessageId endId, int count) Returns stream data of pending messages by group and customer name.pendingRangeAsync
(String groupName, String consumerName, StreamMessageId startId, StreamMessageId endId, long idleTime, TimeUnit idleTimeUnit, int count) Returns stream data of pending messages by group and customer name.pendingRangeAsync
(String groupName, StreamMessageId startId, StreamMessageId endId, int count) Returns stream data of pending messages by group name.pendingRangeAsync
(String groupName, StreamMessageId startId, StreamMessageId endId, long idleTime, TimeUnit idleTimeUnit, int count) Returns stream data of pending messages by group name.rangeAsync
(int count, StreamMessageId startId, StreamMessageId endId) Returns stream data in range by specified start Stream ID (included) and end Stream ID (included).rangeAsync
(StreamMessageId startId, StreamMessageId endId) Returns stream data in range by specified start Stream ID (included) and end Stream ID (included).rangeReversedAsync
(int count, StreamMessageId startId, StreamMessageId endId) Returns stream data in reverse order in range by specified start Stream ID (included) and end Stream ID (included).rangeReversedAsync
(StreamMessageId startId, StreamMessageId endId) Returns stream data in reverse order in range by specified start Stream ID (included) and end Stream ID (included).readAsync
(StreamMultiReadArgs args) Read stream data from multiple streams including current.readAsync
(StreamReadArgs args) Read stream data from current stream only.readGroupAsync
(String groupName, String consumerName, StreamMultiReadGroupArgs args) Read stream data from consumer group and multiple streams including current.readGroupAsync
(String groupName, String consumerName, StreamReadGroupArgs args) Read stream data from consumer group and current stream only.removeAsync
(StreamMessageId... ids) Removes messages by id.removeConsumerAsync
(String groupName, String consumerName) Removes consumer of the group by name.removeGroupAsync
(String groupName) Removes group by name.Returns number of entries in streamtrimAsync
(StreamTrimArgs args) updateGroupMessageIdAsync
(String groupName, StreamMessageId id) Updates next message id delivered to consumers.Methods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, expireIfGreaterAsync, expireIfGreaterAsync, expireIfLessAsync, expireIfLessAsync, expireIfNotSetAsync, expireIfNotSetAsync, expireIfSetAsync, expireIfSetAsync, getExpireTimeAsync, remainTimeToLiveAsync
Methods inherited from interface org.redisson.api.RObjectAsync
copyAndReplaceAsync, copyAndReplaceAsync, copyAsync, copyAsync, copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
-
Method Details
-
createGroupAsync
Creates consumer group.Usage examples:
StreamMessageId id = stream.createGroup(StreamCreateGroupArgs.name("test").id(id).makeStream());
- Parameters:
args
- method arguments object
-
removeGroupAsync
Removes group by name.- Parameters:
groupName
- - name of group- Returns:
- void
-
createConsumerAsync
Creates consumer of the group by name.Requires Redis 6.2.0 and higher.
- Parameters:
groupName
- - name of groupconsumerName
- - name of consumer
-
removeConsumerAsync
Removes consumer of the group by name.- Parameters:
groupName
- - name of groupconsumerName
- - name of consumer- Returns:
- number of pending messages owned by consumer
-
updateGroupMessageIdAsync
Updates next message id delivered to consumers.- Parameters:
groupName
- - name of groupid
- - Stream Message ID- Returns:
- void
-
ackAsync
Marks pending messages by group name and streamids
as correctly processed.- Parameters:
groupName
- - name of groupids
- - stream ids- Returns:
- marked messages amount
-
getPendingInfoAsync
Returns common info about pending messages by group name.- Parameters:
groupName
- - name of group- Returns:
- result object
-
listPendingAsync
RFuture<List<PendingEntry>> listPendingAsync(String groupName, StreamMessageId startId, StreamMessageId endId, long idleTime, TimeUnit idleTimeUnit, int count) Returns list of common info about pending messages by group name. Limited by minimum idle time, messages count, start and end Stream Message IDs.StreamMessageId.MAX
is used as max Stream Message IDStreamMessageId.MIN
is used as min Stream Message IDRequires Redis 6.2.0 and higher.
- Parameters:
groupName
- - name of groupstartId
- - start Stream Message IDendId
- - end Stream Message IDidleTime
- - minimum idle time of messagesidleTimeUnit
- - idle time unitcount
- - amount of messages- Returns:
- list
- See Also:
-
listPendingAsync
RFuture<List<PendingEntry>> listPendingAsync(String groupName, String consumerName, StreamMessageId startId, StreamMessageId endId, long idleTime, TimeUnit idleTimeUnit, int count) Returns list of common info about pending messages by group and consumer name. Limited by minimum idle time, messages count, start and end Stream Message IDs.StreamMessageId.MAX
is used as max Stream Message IDStreamMessageId.MIN
is used as min Stream Message IDRequires Redis 6.2.0 and higher.
- Parameters:
groupName
- - name of groupconsumerName
- - name of consumerstartId
- - start Stream Message IDendId
- - end Stream Message IDidleTime
- - minimum idle time of messagesidleTimeUnit
- - idle time unitcount
- - amount of messages- Returns:
- list
- See Also:
-
listPendingAsync
RFuture<List<PendingEntry>> listPendingAsync(String groupName, StreamMessageId startId, StreamMessageId endId, int count) Returns list of common info about pending messages by group name. Limited by start Stream Message ID and end Stream Message ID and count.StreamMessageId.MAX
is used as max Stream Message IDStreamMessageId.MIN
is used as min Stream Message ID- Parameters:
groupName
- - name of groupstartId
- - start Stream Message IDendId
- - end Stream Message IDcount
- - amount of messages- Returns:
- list
- See Also:
-
listPendingAsync
RFuture<List<PendingEntry>> listPendingAsync(String groupName, String consumerName, StreamMessageId startId, StreamMessageId endId, int count) Returns list of common info about pending messages by group and consumer name. Limited by start Stream Message ID and end Stream Message ID and count.StreamMessageId.MAX
is used as max Stream Message IDStreamMessageId.MIN
is used as min Stream Message ID- Parameters:
groupName
- - name of groupconsumerName
- - name of consumerstartId
- - start Stream Message IDendId
- - end Stream Message IDcount
- - amount of messages- Returns:
- list
- See Also:
-
pendingRangeAsync
RFuture<Map<StreamMessageId,Map<K, pendingRangeAsyncV>>> (String groupName, StreamMessageId startId, StreamMessageId endId, int count) Returns stream data of pending messages by group name. Limited by start Stream Message ID and end Stream Message ID and count.StreamMessageId.MAX
is used as max Stream Message IDStreamMessageId.MIN
is used as min Stream Message ID- Parameters:
groupName
- - name of groupstartId
- - start Stream Message IDendId
- - end Stream Message IDcount
- - amount of messages- Returns:
- map
- See Also:
-
pendingRangeAsync
RFuture<Map<StreamMessageId,Map<K, pendingRangeAsyncV>>> (String groupName, String consumerName, StreamMessageId startId, StreamMessageId endId, int count) Returns stream data of pending messages by group and customer name. Limited by start Stream Message ID and end Stream Message ID and count.StreamMessageId.MAX
is used as max Stream Message IDStreamMessageId.MIN
is used as min Stream Message ID- Parameters:
groupName
- - name of groupconsumerName
- - name of consumerstartId
- - start Stream Message IDendId
- - end Stream Message IDcount
- - amount of messages- Returns:
- map
- See Also:
-
pendingRangeAsync
RFuture<Map<StreamMessageId,Map<K, pendingRangeAsyncV>>> (String groupName, StreamMessageId startId, StreamMessageId endId, long idleTime, TimeUnit idleTimeUnit, int count) Returns stream data of pending messages by group name. Limited by minimum idle time, messages count, start and end Stream Message IDs.StreamMessageId.MAX
is used as max Stream Message IDStreamMessageId.MIN
is used as min Stream Message IDRequires Redis 6.2.0 and higher.
- Parameters:
groupName
- - name of groupstartId
- - start Stream Message IDendId
- - end Stream Message IDidleTime
- - minimum idle time of messagesidleTimeUnit
- - idle time unitcount
- - amount of messages- Returns:
- map
- See Also:
-
pendingRangeAsync
RFuture<Map<StreamMessageId,Map<K, pendingRangeAsyncV>>> (String groupName, String consumerName, StreamMessageId startId, StreamMessageId endId, long idleTime, TimeUnit idleTimeUnit, int count) Returns stream data of pending messages by group and customer name. Limited by minimum idle time, messages count, start and end Stream Message IDs.StreamMessageId.MAX
is used as max Stream Message IDStreamMessageId.MIN
is used as min Stream Message IDRequires Redis 6.2.0 and higher.
- Parameters:
groupName
- - name of groupconsumerName
- - name of consumerstartId
- - start Stream Message IDendId
- - end Stream Message IDidleTime
- - minimum idle time of messagesidleTimeUnit
- - idle time unitcount
- - amount of messages- Returns:
- map
- See Also:
-
autoClaimAsync
RFuture<AutoClaimResult<K,V>> autoClaimAsync(String groupName, String consumerName, long idleTime, TimeUnit idleTimeUnit, StreamMessageId startId, int count) Transfers ownership of pending messages by id to a new consumer by name if idle time of messages and startId are greater than defined value.- Parameters:
groupName
- - name of groupconsumerName
- - name of consumeridleTime
- - minimum idle time of messagesidleTimeUnit
- - idle time unitstartId
- - start Stream Message ID- Returns:
- stream data mapped by Stream ID
-
fastAutoClaimAsync
RFuture<FastAutoClaimResult> fastAutoClaimAsync(String groupName, String consumerName, long idleTime, TimeUnit idleTimeUnit, StreamMessageId startId, int count) Transfers ownership of pending messages by id to a new consumer by name if idle time of messages and startId are greater than defined value.- Parameters:
groupName
- - name of groupconsumerName
- - name of consumeridleTime
- - minimum idle time of messagesidleTimeUnit
- - idle time unitstartId
- - start Stream Message ID- Returns:
- list of Stream Message IDs
-
claimAsync
RFuture<Map<StreamMessageId,Map<K, claimAsyncV>>> (String groupName, String consumerName, long idleTime, TimeUnit idleTimeUnit, StreamMessageId... ids) Transfers ownership of pending messages by id to a new consumer by name if idle time of messages is greater than defined value.- Parameters:
groupName
- - name of groupconsumerName
- - name of consumeridleTime
- - minimum idle time of messagesidleTimeUnit
- - idle time unitids
- - Stream Message IDs- Returns:
- stream data mapped by Stream ID
-
fastClaimAsync
RFuture<List<StreamMessageId>> fastClaimAsync(String groupName, String consumerName, long idleTime, TimeUnit idleTimeUnit, StreamMessageId... ids) Transfers ownership of pending messages by id to a new consumer by name if idle time of messages is greater than defined value.- Parameters:
groupName
- - name of groupconsumerName
- - name of consumeridleTime
- - minimum idle time of messagesidleTimeUnit
- - idle time unitids
- - Stream Message IDs- Returns:
- list of Stream Message IDs
-
readGroupAsync
RFuture<Map<String,Map<StreamMessageId, readGroupAsyncMap<K, V>>>> (String groupName, String consumerName, StreamMultiReadGroupArgs args) Read stream data from consumer group and multiple streams including current.- Parameters:
args
- - method arguments object- Returns:
- stream data mapped by stream name and Stream Message ID
-
readGroupAsync
RFuture<Map<StreamMessageId,Map<K, readGroupAsyncV>>> (String groupName, String consumerName, StreamReadGroupArgs args) Read stream data from consumer group and current stream only.- Parameters:
args
- - method arguments object- Returns:
- stream data mapped by Stream Message ID
-
sizeAsync
Returns number of entries in stream- Returns:
- size of stream
-
addAsync
Appends a new entry/entries and returns generated Stream Message ID- Parameters:
args
- - method arguments object- Returns:
- Stream Message ID
-
addAsync
Appends a new entry/entries by specified Stream Message ID- Parameters:
id
- - Stream Message IDargs
- - method arguments object
-
readAsync
Read stream data from multiple streams including current.- Parameters:
args
- - method arguments object- Returns:
- stream data mapped by stream name and Stream Message ID
-
readAsync
Read stream data from current stream only.- Parameters:
args
- - method arguments object- Returns:
- stream data mapped by Stream Message ID
-
rangeAsync
Returns stream data in range by specified start Stream ID (included) and end Stream ID (included).- Parameters:
startId
- - start Stream IDendId
- - end Stream ID- Returns:
- stream data mapped by Stream ID
-
rangeAsync
RFuture<Map<StreamMessageId,Map<K, rangeAsyncV>>> (int count, StreamMessageId startId, StreamMessageId endId) Returns stream data in range by specified start Stream ID (included) and end Stream ID (included).- Parameters:
count
- - stream data size limitstartId
- - start Stream IDendId
- - end Stream ID- Returns:
- stream data mapped by Stream ID
-
rangeReversedAsync
RFuture<Map<StreamMessageId,Map<K, rangeReversedAsyncV>>> (StreamMessageId startId, StreamMessageId endId) Returns stream data in reverse order in range by specified start Stream ID (included) and end Stream ID (included).- Parameters:
startId
- - start Stream IDendId
- - end Stream ID- Returns:
- stream data mapped by Stream ID
-
rangeReversedAsync
RFuture<Map<StreamMessageId,Map<K, rangeReversedAsyncV>>> (int count, StreamMessageId startId, StreamMessageId endId) Returns stream data in reverse order in range by specified start Stream ID (included) and end Stream ID (included).- Parameters:
count
- - stream data size limitstartId
- - start Stream IDendId
- - end Stream ID- Returns:
- stream data mapped by Stream ID
-
removeAsync
Removes messages by id.- Parameters:
ids
- - id of messages to remove- Returns:
- deleted messages amount
-
trimAsync
-
trimNonStrictAsync
-
getInfoAsync
RFuture<StreamInfo<K,V>> getInfoAsync()Returns information about this stream.- Returns:
- info object
-
listGroupsAsync
RFuture<List<StreamGroup>> listGroupsAsync()Returns list of objects with information about groups belonging to this stream.- Returns:
- list of info objects
-
listConsumersAsync
Returns list of objects with information about group customers for specifiedgroupName
.- Parameters:
groupName
- - name of group- Returns:
- list of info objects
-
addListenerAsync
Adds object event listener- Specified by:
addListenerAsync
in interfaceRObjectAsync
- Parameters:
listener
- object event listener- Returns:
- listener id
- See Also:
-