Interface RStream<K,V>
-
- Type Parameters:
K
- key typeV
- value type
- All Superinterfaces:
RExpirable
,RExpirableAsync
,RObject
,RObjectAsync
,RStreamAsync<K,V>
- All Known Implementing Classes:
RedissonStream
public interface RStream<K,V> extends RStreamAsync<K,V>, RExpirable
Interface for Redis Stream object.Requires Redis 5.0.0 and higher.
- Author:
- Nikita Koksharov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description long
groupName, StreamMessageId... ids)
Marks pending messages by group name and streamids
as correctly processed.StreamMessageId
add(K key, V value)
Deprecated.StreamMessageId
add(K key, V value, int trimLen, boolean trimStrict)
Deprecated.StreamMessageId
add(StreamAddArgs<K,V> args)
Appends a new entry/entries and returns generated Stream Message IDvoid
add(StreamMessageId id, K key, V value)
Deprecated.void
add(StreamMessageId id, K key, V value, int trimLen, boolean trimStrict)
Deprecated.void
add(StreamMessageId id, StreamAddArgs<K,V> args)
Appends a new entry/entries by specified Stream Message IDStreamMessageId
<K,V> entries)
Deprecated.StreamMessageId
<K,V> entries, int trimLen, boolean trimStrict)
Deprecated.void
addAll(StreamMessageId id, <K,V> entries)
Deprecated.void
addAll(StreamMessageId id, <K,V> entries, int trimLen, boolean trimStrict)
Deprecated.AutoClaimResult<K,V>
groupName, consumerName, long idleTime, 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.<<K,V>>
groupName, consumerName, long idleTime, 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.void
groupName, consumerName)
Creates consumer of the group by name.void
groupName)
Creates consumer group by name.void
groupName, StreamMessageId id)
Creates consumer group by name and Stream Message ID.FastAutoClaimResult
groupName, consumerName, long idleTime, 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.<StreamMessageId>
groupName, consumerName, long idleTime, 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.StreamInfo<K,V>
getInfo()
Returns information about this stream.PendingResult
groupName)
Returns common info about pending messages by group name.<StreamConsumer>
groupName)
Returns list of common info about group customers for specifiedgroupName
.<StreamGroup>
listGroups()
Returns list of common info about groups belonging to this stream.<PendingEntry>
groupName, consumerName, StreamMessageId startId, StreamMessageId endId, int count)
Returns list of common info about pending messages by group and consumer name.<PendingEntry>
groupName, consumerName, StreamMessageId startId, StreamMessageId endId, long idleTime, idleTimeUnit, int count)
Returns stream data of pending messages by group and customer name.<PendingEntry>
groupName, StreamMessageId startId, StreamMessageId endId, int count)
Returns list of common info about pending messages by group name.<PendingEntry>
groupName, StreamMessageId startId, StreamMessageId endId, long idleTime, idleTimeUnit, int count)
Returns stream data of pending messages by group name.<<K,V>>
groupName, consumerName, StreamMessageId startId, StreamMessageId endId, int count)
Returns stream data of pending messages by group and customer name.<<K,V>>
groupName, consumerName, StreamMessageId startId, StreamMessageId endId, long idleTime, idleTimeUnit, int count)
Returns stream data of pending messages by group and customer name.<<K,V>>
groupName, StreamMessageId startId, StreamMessageId endId, int count)
Returns stream data of pending messages by group name.<<K,V>>
groupName, StreamMessageId startId, StreamMessageId endId, long idleTime, idleTimeUnit, int count)
Returns stream data of pending messages by group name.<<K,V>>
range(int count, StreamMessageId startId, StreamMessageId endId)
Returns stream data in range by specified start Stream Message ID (included) and end Stream Message ID (included).<<K,V>>
range(StreamMessageId startId, StreamMessageId endId)
Returns stream data in range by specified start Stream Message ID (included) and end Stream Message ID (included).<<K,V>>
rangeReversed(int count, StreamMessageId startId, StreamMessageId endId)
Returns stream data in reverse order in range by specified start Stream Message ID (included) and end Stream Message ID (included).<<K,V>>
rangeReversed(StreamMessageId startId, StreamMessageId endId)
Returns stream data in reverse order in range by specified start Stream Message ID (included) and end Stream Message ID (included).<<K,V>>
read(int count, long timeout, unit, StreamMessageId... ids)
Deprecated.<,<<K,V>>>
read(int count, long timeout, unit, StreamMessageId id, name2, StreamMessageId id2)
Deprecated.<,<<K,V>>>
read(int count, long timeout, unit, StreamMessageId id, name2, StreamMessageId id2, name3, StreamMessageId id3)
Deprecated.<,<<K,V>>>
read(int count, long timeout, unit, StreamMessageId id, <,StreamMessageId> nameToId)
Deprecated.<<K,V>>
read(int count, StreamMessageId... ids)
Deprecated.<,<<K,V>>>
read(int count, StreamMessageId id, name2, StreamMessageId id2)
Deprecated.<,<<K,V>>>
read(int count, StreamMessageId id, name2, StreamMessageId id2, name3, StreamMessageId id3)
Deprecated.<,<<K,V>>>
read(int count, StreamMessageId id, <,StreamMessageId> nameToId)
Deprecated.<<K,V>>
read(long timeout, unit, StreamMessageId... ids)
Deprecated.<,<<K,V>>>
read(long timeout, unit, StreamMessageId id, name2, StreamMessageId id2)
Deprecated.<,<<K,V>>>
read(long timeout, unit, StreamMessageId id, name2, StreamMessageId id2, name3, StreamMessageId id3)
Deprecated.<,<<K,V>>>
read(long timeout, unit, StreamMessageId id, <,StreamMessageId> nameToId)
Deprecated.<,<<K,V>>>
read(StreamMultiReadArgs args)
Read stream data from multiple streams including current.<<K,V>>
read(StreamReadArgs args)
Read stream data from current stream only.<<K,V>>
read(StreamMessageId... ids)
Deprecated.<,<<K,V>>>
read(StreamMessageId id, name2, StreamMessageId id2)
Deprecated.<,<<K,V>>>
read(StreamMessageId id, name2, StreamMessageId id2, name3, StreamMessageId id3)
Deprecated.<,<<K,V>>>
read(StreamMessageId id, <,StreamMessageId> nameToId)
Deprecated.<<K,V>>
groupName, consumerName, int count, long timeout, unit, StreamMessageId... ids)
Deprecated.<,<<K,V>>>
groupName, consumerName, int count, long timeout, unit, StreamMessageId id, key2, StreamMessageId id2)
Deprecated.<,<<K,V>>>
groupName, consumerName, int count, long timeout, unit, StreamMessageId id, key2, StreamMessageId id2, key3, StreamMessageId id3)
Deprecated.<,<<K,V>>>
groupName, consumerName, int count, long timeout, unit, StreamMessageId id, <,StreamMessageId> nameToId)
Deprecated.<<K,V>>
groupName, consumerName, int count, StreamMessageId... ids)
Deprecated.<,<<K,V>>>
groupName, consumerName, int count, StreamMessageId id, key2, StreamMessageId id2)
Deprecated.<,<<K,V>>>
groupName, consumerName, int count, StreamMessageId id, key2, StreamMessageId id2, key3, StreamMessageId id3)
Deprecated.<,<<K,V>>>
groupName, consumerName, int count, StreamMessageId id, <,StreamMessageId> nameToId)
Deprecated.<<K,V>>
groupName, consumerName, long timeout, unit, StreamMessageId... ids)
Deprecated.<,<<K,V>>>
groupName, consumerName, long timeout, unit, StreamMessageId id, key2, StreamMessageId id2)
Deprecated.<,<<K,V>>>
groupName, consumerName, long timeout, unit, StreamMessageId id, key2, StreamMessageId id2, key3, StreamMessageId id3)
Deprecated.<,<<K,V>>>
groupName, consumerName, long timeout, unit, StreamMessageId id, <,StreamMessageId> nameToId)
Deprecated.<,<<K,V>>>
groupName, consumerName, StreamMultiReadGroupArgs args)
Read stream data from consumer group and multiple streams including current.<<K,V>>
groupName, consumerName, StreamReadGroupArgs args)
Read stream data from consumer group and current stream only.<<K,V>>
groupName, consumerName, StreamMessageId... ids)
Deprecated.<,<<K,V>>>
groupName, consumerName, StreamMessageId id, key2, StreamMessageId id2)
Deprecated.<,<<K,V>>>
groupName, consumerName, StreamMessageId id, key2, StreamMessageId id2, key3, StreamMessageId id3)
Deprecated.<,<<K,V>>>
groupName, consumerName, StreamMessageId id, <,StreamMessageId> nameToId)
Deprecated.long
remove(StreamMessageId... ids)
Removes messages by id.long
groupName, consumerName)
Removes consumer of the group by name.void
groupName)
Removes group by name.long
size()
Returns number of entries in streamlong
trim(int size)
Trims stream using MAXLEN strategy to specified sizelong
trim(TrimStrategy strategy, int threshold)
Trims stream to specified sizelong
trimNonStrict(int size)
Trims stream using MAXLEN strategy to almost exact trimming threshold..long
trimNonStrict(TrimStrategy strategy, int threshold)
Trims stream using almost exact trimming threshold.long
trimNonStrict(TrimStrategy strategy, int threshold, int limit)
Trims stream using almost exact trimming threshold up to limit.void
groupName, StreamMessageId id)
Updates next message id delivered to consumers.-
Methods inherited from interface org.redisson.api.RExpirable
clearExpire, expire, expire, expireAt, expireAt, remainTimeToLive
-
Methods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, remainTimeToLiveAsync
-
Methods inherited from interface org.redisson.api.RObject
addListener, copy, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
-
Methods inherited from interface org.redisson.api.RObjectAsync
addListenerAsync, copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
-
Methods inherited from interface org.redisson.api.RStreamAsync
ackAsync, addAllAsync, addAllAsync, addAllAsync, addAllAsync, addAsync, addAsync, addAsync, addAsync, addAsync, addAsync, autoClaimAsync, claimAsync, createConsumerAsync, createGroupAsync, createGroupAsync, fastAutoClaimAsync, fastClaimAsync, getInfoAsync, getPendingInfoAsync, listConsumersAsync, listGroupsAsync, listPendingAsync, listPendingAsync, listPendingAsync, listPendingAsync, pendingRangeAsync, pendingRangeAsync, pendingRangeAsync, pendingRangeAsync, rangeAsync, rangeAsync, rangeReversedAsync, rangeReversedAsync, readAsync, readAsync, readAsync, readAsync, readAsync, readAsync, readAsync, readAsync, readAsync, readAsync, readAsync, readAsync, readAsync, readAsync, readAsync, readAsync, readAsync, readAsync, readGroupAsync, readGroupAsync, readGroupAsync, readGroupAsync, readGroupAsync, readGroupAsync, readGroupAsync, readGroupAsync, readGroupAsync, readGroupAsync, readGroupAsync, readGroupAsync, readGroupAsync, readGroupAsync, readGroupAsync, readGroupAsync, readGroupAsync, removeAsync, removeConsumerAsync, removeGroupAsync, sizeAsync, trimAsync, trimAsync, trimNonStrictAsync, trimNonStrictAsync, trimNonStrictAsync, updateGroupMessageIdAsync
-
-
-
-
Method Detail
-
createGroup
void createGroup( groupName)
Creates consumer group by name. Only new messages will be available for consumers of this group.- Parameters:
groupName
- - name of group
-
createGroup
void createGroup( groupName, StreamMessageId id)
Creates consumer group by name and Stream Message ID. Only new messages after defined streamid
will be available for consumers of this group.StreamMessageId.NEWEST
is used for messages arrived since the moment of group creationStreamMessageId.ALL
is used for all messages added before and after the moment of group creation- Parameters:
groupName
- - name of groupid
- - Stream Message ID
-
removeGroup
void removeGroup( groupName)
Removes group by name.- Parameters:
groupName
- - name of group
-
createConsumer
void createConsumer( groupName, consumerName)
Creates consumer of the group by name.Requires Redis 6.2.0 and higher.
- Parameters:
groupName
- - name of groupconsumerName
- - name of consumer
-
removeConsumer
long removeConsumer( groupName, consumerName)
Removes consumer of the group by name.- Parameters:
groupName
- - name of groupconsumerName
- - name of consumer- Returns:
- number of pending messages owned by consumer
-
updateGroupMessageId
void updateGroupMessageId( groupName, StreamMessageId id)
Updates next message id delivered to consumers.- Parameters:
groupName
- - name of groupid
- - Stream Message ID
-
ack
long ack( groupName, StreamMessageId... ids)
Marks pending messages by group name and streamids
as correctly processed.- Parameters:
groupName
- - name of groupids
- - Stream Message IDs- Returns:
- marked messages amount
-
getPendingInfo
groupName)
Returns common info about pending messages by group name.- Parameters:
groupName
- - name of group- Returns:
- result object
-
listPending
< 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:
RStreamAsync.pendingRangeAsync(java.lang.String, org.redisson.api.StreamMessageId, org.redisson.api.StreamMessageId, int)
-
listPending
< groupName, 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:
consumerName
- - name of consumergroupName
- - name of groupstartId
- - start Stream Message IDendId
- - end Stream Message IDcount
- - amount of messages- Returns:
- list
- See Also:
RStreamAsync.pendingRangeAsync(java.lang.String, org.redisson.api.StreamMessageId, org.redisson.api.StreamMessageId, int)
-
listPending
< groupName, StreamMessageId startId, StreamMessageId endId, long idleTime, 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:
RStreamAsync.listPendingAsync(java.lang.String, org.redisson.api.StreamMessageId, org.redisson.api.StreamMessageId, long, java.util.concurrent.TimeUnit, int)
-
listPending
< groupName, consumerName, StreamMessageId startId, StreamMessageId endId, long idleTime, 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:
consumerName
- - name of consumergroupName
- - 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:
RStreamAsync.listPendingAsync(java.lang.String, org.redisson.api.StreamMessageId, org.redisson.api.StreamMessageId, long, java.util.concurrent.TimeUnit, int)
-
pendingRange
<< 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:
listPending(java.lang.String, org.redisson.api.StreamMessageId, org.redisson.api.StreamMessageId, int)
-
pendingRange
<< groupName, 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:
consumerName
- - name of consumergroupName
- - name of groupstartId
- - start Stream Message IDendId
- - end Stream Message IDcount
- - amount of messages- Returns:
- map
- See Also:
listPending(java.lang.String, org.redisson.api.StreamMessageId, org.redisson.api.StreamMessageId, int)
-
pendingRange
<< groupName, StreamMessageId startId, StreamMessageId endId, long idleTime, 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:
RStreamAsync.listPendingAsync(java.lang.String, org.redisson.api.StreamMessageId, org.redisson.api.StreamMessageId, long, java.util.concurrent.TimeUnit, int)
-
pendingRange
<< groupName, consumerName, StreamMessageId startId, StreamMessageId endId, long idleTime, 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:
consumerName
- - name of consumergroupName
- - 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:
RStreamAsync.listPendingAsync(java.lang.String, org.redisson.api.StreamMessageId, org.redisson.api.StreamMessageId, long, java.util.concurrent.TimeUnit, int)
-
autoClaim
groupName, consumerName, long idleTime, 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
-
claim
<< groupName, consumerName, long idleTime, 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 Message ID
-
fastClaim
< groupName, consumerName, long idleTime, 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
-
fastAutoClaim
groupName, consumerName, long idleTime, 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
-
readGroup
<,<< groupName, consumerName, StreamMultiReadGroupArgs args)
Read stream data from consumer group and multiple streams including current.Usage examples:
Map result = stream.read("group1", "consumer1", StreamMultiReadGroupArgs.greaterThan(id, "stream2", id2));
Map result = stream.read("group1", "consumer1", StreamMultiReadGroupArgs.greaterThan(id, "stream2", id2) .count(100) .timeout(Duration.ofSeconds(5))));
- Parameters:
args
- - method arguments object- Returns:
- stream data mapped by stream name and Stream Message ID
-
readGroup
<< groupName, consumerName, StreamReadGroupArgs args)
Read stream data from consumer group and current stream only.Usage examples:
Map result = stream.read("group1", "consumer1", StreamReadGroupArgs.greaterThan(id));
Map result = stream.read("group1", "consumer1", StreamReadGroupArgs.greaterThan(id) .count(100) .timeout(Duration.ofSeconds(5))));
- Parameters:
args
- - method arguments object- Returns:
- stream data mapped by Stream Message ID
-
readGroup
<< groupName, consumerName, StreamMessageId... ids)
Deprecated.
-
readGroup
<< groupName, consumerName, int count, StreamMessageId... ids)
Deprecated.
-
readGroup
<< groupName, consumerName, long timeout, unit, StreamMessageId... ids)
Deprecated.
-
readGroup
<< groupName, consumerName, int count, long timeout, unit, StreamMessageId... ids)
Deprecated.
-
readGroup
<,<< groupName, consumerName, StreamMessageId id, <,StreamMessageId> nameToId)
Deprecated.
-
readGroup
<,<< groupName, consumerName, int count, StreamMessageId id, <,StreamMessageId> nameToId)
Deprecated.
-
readGroup
<,<< groupName, consumerName, int count, long timeout, unit, StreamMessageId id, <,StreamMessageId> nameToId)
Deprecated.
-
readGroup
<,<< groupName, consumerName, long timeout, unit, StreamMessageId id, <,StreamMessageId> nameToId)
Deprecated.
-
readGroup
<,<< groupName, consumerName, StreamMessageId id, key2, StreamMessageId id2)
Deprecated.
-
readGroup
<,<< groupName, consumerName, StreamMessageId id, key2, StreamMessageId id2, key3, StreamMessageId id3)
Deprecated.
-
readGroup
<,<< groupName, consumerName, int count, StreamMessageId id, key2, StreamMessageId id2)
Deprecated.
-
readGroup
<,<< groupName, consumerName, int count, StreamMessageId id, key2, StreamMessageId id2, key3, StreamMessageId id3)
Deprecated.
-
readGroup
<,<< groupName, consumerName, long timeout, unit, StreamMessageId id, key2, StreamMessageId id2)
Deprecated.
-
readGroup
<,<< groupName, consumerName, long timeout, unit, StreamMessageId id, key2, StreamMessageId id2, key3, StreamMessageId id3)
Deprecated.
-
readGroup
<,<< groupName, consumerName, int count, long timeout, unit, StreamMessageId id, key2, StreamMessageId id2)
Deprecated.
-
readGroup
<,<< groupName, consumerName, int count, long timeout, unit, StreamMessageId id, key2, StreamMessageId id2, key3, StreamMessageId id3)
Deprecated.
-
size
long size()
Returns number of entries in stream- Returns:
- size of stream
-
add
StreamMessageId add(StreamAddArgs<K,V> args)
Appends a new entry/entries and returns generated Stream Message IDUsage examples:
StreamMessageId id = stream.add(StreamAddArgs.entry(15, 37));
StreamMessageId id = stream.add(StreamAddArgs.entries(15, 37, 23, 43) .trim(TrimStrategy.MAXLEN, 100)));
- Parameters:
args
- - method arguments object- Returns:
- Stream Message ID
-
add
void add(StreamMessageId id, StreamAddArgs<K,V> args)
Appends a new entry/entries by specified Stream Message IDUsage examples:
stream.add(id, StreamAddArgs.entry(15, 37));
stream.add(id, StreamAddArgs.entries(15, 37, 23, 43) .trim(TrimStrategy.MAXLEN, 100)));
- Parameters:
id
- - Stream Message IDargs
- - method arguments object
-
add
StreamMessageId add(K key, V value)
Deprecated.
-
add
void add(StreamMessageId id, K key, V value)
Deprecated.
-
add
StreamMessageId add(K key, V value, int trimLen, boolean trimStrict)
Deprecated.
-
add
void add(StreamMessageId id, K key, V value, int trimLen, boolean trimStrict)
Deprecated.
-
addAll
void addAll(StreamMessageId id, <K,V> entries)
Deprecated.
-
addAll
void addAll(StreamMessageId id, <K,V> entries, int trimLen, boolean trimStrict)
Deprecated.
-
read
<,<<K,V>>> read(StreamMultiReadArgs args)
Read stream data from multiple streams including current.Usage examples:
Map result = stream.read(StreamMultiReadArgs.greaterThan(id, "stream2", id2));
Map result = stream.read(StreamMultiReadArgs.greaterThan(id, "stream2", id2) .count(100) .timeout(Duration.ofSeconds(5))));
- Parameters:
args
- - method arguments object- Returns:
- stream data mapped by stream name and Stream Message ID
-
read
<<K,V>> read(StreamReadArgs args)
Read stream data from current stream only.Usage examples:
Map result = stream.read(StreamReadArgs.greaterThan(id));
Map result = stream.read(StreamReadArgs.greaterThan(id) .count(100) .timeout(Duration.ofSeconds(5))));
- Parameters:
args
- - method arguments object- Returns:
- stream data mapped by Stream Message ID
-
read
<<K,V>> read(StreamMessageId... ids)
Deprecated.
-
read
<<K,V>> read(int count, StreamMessageId... ids)
Deprecated.
-
read
<<K,V>> read(long timeout, unit, StreamMessageId... ids)
Deprecated.
-
read
<<K,V>> read(int count, long timeout, unit, StreamMessageId... ids)
Deprecated.
-
read
<,<<K,V>>> read(StreamMessageId id, name2, StreamMessageId id2)
Deprecated.
-
read
<,<<K,V>>> read(StreamMessageId id, name2, StreamMessageId id2, name3, StreamMessageId id3)
Deprecated.
-
read
<,<<K,V>>> read(StreamMessageId id, <,StreamMessageId> nameToId)
Deprecated.
-
read
<,<<K,V>>> read(int count, StreamMessageId id, name2, StreamMessageId id2)
Deprecated.
-
read
<,<<K,V>>> read(int count, StreamMessageId id, name2, StreamMessageId id2, name3, StreamMessageId id3)
Deprecated.
-
read
<,<<K,V>>> read(int count, StreamMessageId id, <,StreamMessageId> nameToId)
Deprecated.
-
read
<,<<K,V>>> read(long timeout, unit, StreamMessageId id, name2, StreamMessageId id2)
Deprecated.
-
read
<,<<K,V>>> read(long timeout, unit, StreamMessageId id, name2, StreamMessageId id2, name3, StreamMessageId id3)
Deprecated.
-
read
<,<<K,V>>> read(long timeout, unit, StreamMessageId id, <,StreamMessageId> nameToId)
Deprecated.
-
read
<,<<K,V>>> read(int count, long timeout, unit, StreamMessageId id, name2, StreamMessageId id2)
Deprecated.
-
read
<,<<K,V>>> read(int count, long timeout, unit, StreamMessageId id, name2, StreamMessageId id2, name3, StreamMessageId id3)
Deprecated.
-
read
<,<<K,V>>> read(int count, long timeout, unit, StreamMessageId id, <,StreamMessageId> nameToId)
Deprecated.
-
range
<<K,V>> range(StreamMessageId startId, StreamMessageId endId)
Returns stream data in range by specified start Stream Message ID (included) and end Stream Message ID (included).- Parameters:
startId
- - start Stream Message IDendId
- - end Stream Message ID- Returns:
- stream data mapped by Stream Message ID
-
range
<<K,V>> range(int count, StreamMessageId startId, StreamMessageId endId)
Returns stream data in range by specified start Stream Message ID (included) and end Stream Message ID (included).- Parameters:
count
- - stream data size limitstartId
- - start Stream Message IDendId
- - end Stream Message ID- Returns:
- stream data mapped by Stream Message ID
-
rangeReversed
<<K,V>> rangeReversed(StreamMessageId startId, StreamMessageId endId)
Returns stream data in reverse order in range by specified start Stream Message ID (included) and end Stream Message ID (included).- Parameters:
startId
- - start Stream Message IDendId
- - end Stream Message ID- Returns:
- stream data mapped by Stream Message ID
-
rangeReversed
<<K,V>> rangeReversed(int count, StreamMessageId startId, StreamMessageId endId)
Returns stream data in reverse order in range by specified start Stream Message ID (included) and end Stream Message ID (included).- Parameters:
count
- - stream data size limitstartId
- - start Stream Message IDendId
- - end Stream Message ID- Returns:
- stream data mapped by Stream Message ID
-
remove
long remove(StreamMessageId... ids)
Removes messages by id.- Parameters:
ids
- - id of messages to remove- Returns:
- deleted messages amount
-
trim
long trim(int size)
Trims stream using MAXLEN strategy to specified size- Parameters:
size
- - new size of stream- Returns:
- number of deleted messages
-
trim
long trim(TrimStrategy strategy, int threshold)
Trims stream to specified size- Parameters:
strategy
- - trim strategythreshold
- - new size of stream- Returns:
- number of deleted messages
-
trimNonStrict
long trimNonStrict(int size)
Trims stream using MAXLEN strategy to almost exact trimming threshold..- Parameters:
size
- - new size of stream- Returns:
- number of deleted messages
-
trimNonStrict
long trimNonStrict(TrimStrategy strategy, int threshold)
Trims stream using almost exact trimming threshold.- Parameters:
strategy
- - trim strategythreshold
- - trim threshold- Returns:
- number of deleted messages
-
trimNonStrict
long trimNonStrict(TrimStrategy strategy, int threshold, int limit)
Trims stream using almost exact trimming threshold up to limit.- Parameters:
strategy
- - trim strategythreshold
- - trim thresholdlimit
- - trim limit- Returns:
- number of deleted messages
-
getInfo
StreamInfo<K,V> getInfo()
Returns information about this stream.- Returns:
- info object
-
listGroups
<StreamGroup> listGroups()
Returns list of common info about groups belonging to this stream.- Returns:
- list of info objects
-
listConsumers
< groupName)
Returns list of common info about group customers for specifiedgroupName
.- Parameters:
groupName
- - name of group- Returns:
- list of info objects
-
-