Package org.redisson.api
Interface RStreamReactive<K,V>
-
- Type Parameters:
K
- key typeV
- value type
- All Superinterfaces:
RExpirableReactive
,RObjectReactive
public interface RStreamReactive<K,V> extends RExpirableReactive
Reactive interface for Redis Stream object.Requires Redis 5.0.0 and higher.
- Author:
- Nikita Koksharov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.reactivestreams.Publisher<Long>
ack(String groupName, StreamMessageId... ids)
Marks pending messages by group name and streamids
as correctly processed.org.reactivestreams.Publisher<StreamMessageId>
add(K key, V value)
Appends a new entry and returns generated Stream IDorg.reactivestreams.Publisher<StreamMessageId>
add(K key, V value, int trimLen, boolean trimStrict)
Appends a new entry and returns generated Stream ID.org.reactivestreams.Publisher<Void>
add(StreamMessageId id, K key, V value)
Appends a new entry by specified Stream IDorg.reactivestreams.Publisher<Void>
add(StreamMessageId id, K key, V value, int trimLen, boolean trimStrict)
Appends a new entry by specified Stream ID.org.reactivestreams.Publisher<StreamMessageId>
addAll(Map<K,V> entries)
Appends new entries and returns generated Stream IDorg.reactivestreams.Publisher<StreamMessageId>
addAll(Map<K,V> entries, int trimLen, boolean trimStrict)
Appends new entries and returns generated Stream ID.org.reactivestreams.Publisher<Void>
addAll(StreamMessageId id, Map<K,V> entries)
Appends new entries by specified Stream IDorg.reactivestreams.Publisher<Void>
addAll(StreamMessageId id, Map<K,V> entries, int trimLen, boolean trimStrict)
Appends new entries by specified Stream ID.org.reactivestreams.Publisher<Map<StreamMessageId,Map<K,V>>>
claim(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.org.reactivestreams.Publisher<Void>
createGroup(String groupName)
Creates consumer group by name.org.reactivestreams.Publisher<Void>
createGroup(String groupName, StreamMessageId id)
Creates consumer group by name and stream id.org.reactivestreams.Publisher<PendingResult>
listPending(String groupName)
Returns pending messages by group nameorg.reactivestreams.Publisher<List<PendingEntry>>
listPending(String groupName, String consumerName, StreamMessageId startId, StreamMessageId endId, int count)
Returns list of pending messages by group name and consumer name.org.reactivestreams.Publisher<List<PendingEntry>>
listPending(String groupName, StreamMessageId startId, StreamMessageId endId, int count)
Returns list of pending messages by group name.org.reactivestreams.Publisher<Map<StreamMessageId,Map<K,V>>>
range(int count, StreamMessageId startId, StreamMessageId endId)
Read stream data in range by specified start Stream ID (included) and end Stream ID (included).org.reactivestreams.Publisher<Map<StreamMessageId,Map<K,V>>>
range(StreamMessageId startId, StreamMessageId endId)
Read stream data in range by specified start Stream ID (included) and end Stream ID (included).org.reactivestreams.Publisher<Map<StreamMessageId,Map<K,V>>>
rangeReversed(int count, StreamMessageId startId, StreamMessageId endId)
Read stream data in reverse order in range by specified start Stream ID (included) and end Stream ID (included).org.reactivestreams.Publisher<Map<StreamMessageId,Map<K,V>>>
rangeReversed(StreamMessageId startId, StreamMessageId endId)
Read stream data in reverse order in range by specified start Stream ID (included) and end Stream ID (included).org.reactivestreams.Publisher<Map<StreamMessageId,Map<K,V>>>
read(int count, long timeout, TimeUnit unit, StreamMessageId... ids)
Read stream data by specified collection of Stream IDs.org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>>
read(int count, long timeout, TimeUnit unit, StreamMessageId id, String name2, StreamMessageId id2)
Read stream data by specified stream name including this stream.org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>>
read(int count, long timeout, TimeUnit unit, StreamMessageId id, String name2, StreamMessageId id2, String name3, StreamMessageId id3)
Read stream data by specified stream names including this stream.org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>>
read(int count, long timeout, TimeUnit unit, StreamMessageId id, Map<String,StreamMessageId> nameToId)
Read stream data by specified stream id mapped by name including this stream.org.reactivestreams.Publisher<Map<StreamMessageId,Map<K,V>>>
read(int count, StreamMessageId... ids)
Read stream data by specified collection of Stream IDs.org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>>
read(int count, StreamMessageId id, String name2, StreamMessageId id2)
Read stream data by specified stream name including this stream.org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>>
read(int count, StreamMessageId id, String name2, StreamMessageId id2, String name3, StreamMessageId id3)
Read stream data by specified stream names including this stream.org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>>
read(int count, StreamMessageId id, Map<String,StreamMessageId> nameToId)
Read stream data by specified stream id mapped by name including this stream.org.reactivestreams.Publisher<Map<StreamMessageId,Map<K,V>>>
read(long timeout, TimeUnit unit, StreamMessageId... ids)
Read stream data by specified collection of Stream IDs.org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>>
read(long timeout, TimeUnit unit, StreamMessageId id, String name2, StreamMessageId id2)
Read stream data by specified stream name including this stream.org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>>
read(long timeout, TimeUnit unit, StreamMessageId id, String name2, StreamMessageId id2, String name3, StreamMessageId id3)
Read stream data by specified stream names including this stream.org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>>
read(long timeout, TimeUnit unit, StreamMessageId id, Map<String,StreamMessageId> nameToId)
Read stream data by specified stream id mapped by name including this stream.org.reactivestreams.Publisher<Map<StreamMessageId,Map<K,V>>>
read(StreamMessageId... ids)
Read stream data by specified collection of Stream IDs.org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>>
read(StreamMessageId id, String name2, StreamMessageId id2)
Read stream data by specified stream name including this stream.org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>>
read(StreamMessageId id, String name2, StreamMessageId id2, String name3, StreamMessageId id3)
Read stream data by specified stream names including this stream.org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>>
read(StreamMessageId id, Map<String,StreamMessageId> nameToId)
Read stream data by specified stream id mapped by name including this stream.org.reactivestreams.Publisher<Map<StreamMessageId,Map<K,V>>>
readGroup(String groupName, String consumerName, int count, long timeout, TimeUnit unit, StreamMessageId... ids)
Read stream data fromgroupName
byconsumerName
and specified collection of Stream IDs.org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>>
readGroup(String groupName, String consumerName, int count, long timeout, TimeUnit unit, StreamMessageId id, String key2, StreamMessageId id2)
Read stream data fromgroupName
byconsumerName
, starting by specified message ids for this and other streams.org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>>
readGroup(String groupName, String consumerName, int count, long timeout, TimeUnit unit, StreamMessageId id, String key2, StreamMessageId id2, String key3, StreamMessageId id3)
Read stream data fromgroupName
byconsumerName
, starting by specified message ids for this and other streams.org.reactivestreams.Publisher<Map<StreamMessageId,Map<K,V>>>
readGroup(String groupName, String consumerName, int count, StreamMessageId... ids)
Read stream data fromgroupName
byconsumerName
and specified collection of Stream IDs.org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>>
readGroup(String groupName, String consumerName, int count, StreamMessageId id, String key2, StreamMessageId id2)
Read stream data fromgroupName
byconsumerName
, starting by specified message ids for this and other streams.org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>>
readGroup(String groupName, String consumerName, int count, StreamMessageId id, String key2, StreamMessageId id2, String key3, StreamMessageId id3)
Read stream data fromgroupName
byconsumerName
, starting by specified message ids for this and other streams.org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>>
readGroup(String groupName, String consumerName, int count, StreamMessageId id, Map<String,StreamMessageId> nameToId)
Read stream data fromgroupName
byconsumerName
, starting by specified message ids for this and other streams.org.reactivestreams.Publisher<Map<StreamMessageId,Map<K,V>>>
readGroup(String groupName, String consumerName, long timeout, TimeUnit unit, StreamMessageId... ids)
Read stream data fromgroupName
byconsumerName
and specified collection of Stream IDs.org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>>
readGroup(String groupName, String consumerName, long timeout, TimeUnit unit, StreamMessageId id, String key2, StreamMessageId id2)
Read stream data fromgroupName
byconsumerName
, starting by specified message ids for this and other streams.org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>>
readGroup(String groupName, String consumerName, long timeout, TimeUnit unit, StreamMessageId id, String key2, StreamMessageId id2, String key3, StreamMessageId id3)
Read stream data fromgroupName
byconsumerName
, starting by specified message ids for this and other streams.org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>>
readGroup(String groupName, String consumerName, long timeout, TimeUnit unit, StreamMessageId id, Map<String,StreamMessageId> nameToId)
Read stream data fromgroupName
byconsumerName
, starting by specified message ids for this and other streams.org.reactivestreams.Publisher<Map<StreamMessageId,Map<K,V>>>
readGroup(String groupName, String consumerName, StreamMessageId... ids)
Read stream data fromgroupName
byconsumerName
and specified collection of Stream IDs.org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>>
readGroup(String groupName, String consumerName, StreamMessageId id, String key2, StreamMessageId id2)
Read stream data fromgroupName
byconsumerName
, starting by specified message ids for this and other streams.org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>>
readGroup(String groupName, String consumerName, StreamMessageId id, String key2, StreamMessageId id2, String key3, StreamMessageId id3)
Read stream data fromgroupName
byconsumerName
, starting by specified message ids for this and other streams.org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>>
readGroup(String groupName, String consumerName, StreamMessageId id, Map<String,StreamMessageId> nameToId)
Read stream data fromgroupName
byconsumerName
, starting by specified message ids for this and other streams.org.reactivestreams.Publisher<Long>
remove(StreamMessageId... ids)
Removes messages by id.org.reactivestreams.Publisher<Long>
removeConsumer(String groupName, String consumerName)
Removes consumer of the group by name.org.reactivestreams.Publisher<Void>
removeGroup(String groupName)
Removes group by name.org.reactivestreams.Publisher<Long>
size()
Returns number of entries in streamorg.reactivestreams.Publisher<Long>
trim(int size)
Trims stream to specified sizeorg.reactivestreams.Publisher<Long>
trimNonStrict(int size)
Trims stream to few tens of entries more than specified length to trim.org.reactivestreams.Publisher<Void>
updateGroupMessageId(String groupName, StreamMessageId id)
Updates next message id delivered to consumers.-
Methods inherited from interface org.redisson.api.RExpirableReactive
clearExpire, expire, expireAt, expireAt, remainTimeToLive
-
-
-
-
Method Detail
-
createGroup
org.reactivestreams.Publisher<Void> createGroup(String groupName)
Creates consumer group by name.- Parameters:
groupName
- - name of group- Returns:
- void
-
createGroup
org.reactivestreams.Publisher<Void> createGroup(String groupName, StreamMessageId id)
Creates consumer group by name and stream 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 creating- Parameters:
groupName
- - name of groupid
- - stream id- Returns:
- void
-
removeGroup
org.reactivestreams.Publisher<Void> removeGroup(String groupName)
Removes group by name.- Parameters:
groupName
- - name of group- Returns:
- void
-
removeConsumer
org.reactivestreams.Publisher<Long> removeConsumer(String groupName, String 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
org.reactivestreams.Publisher<Void> updateGroupMessageId(String groupName, StreamMessageId id)
Updates next message id delivered to consumers.- Parameters:
groupName
- - name of groupid
- - Stream Message ID- Returns:
- void
-
ack
org.reactivestreams.Publisher<Long> ack(String groupName, StreamMessageId... ids)
Marks pending messages by group name and streamids
as correctly processed.- Parameters:
groupName
- - name of groupids
- - stream ids- Returns:
- marked messages amount
-
listPending
org.reactivestreams.Publisher<PendingResult> listPending(String groupName)
Returns pending messages by group name- Parameters:
groupName
- - name of group- Returns:
- result object
-
listPending
org.reactivestreams.Publisher<List<PendingEntry>> listPending(String groupName, StreamMessageId startId, StreamMessageId endId, int count)
Returns list of pending messages by group name. Limited by start stream id and end stream id and count.StreamMessageId.MAX
is used as max stream idStreamMessageId.MIN
is used as min stream id- Parameters:
groupName
- - name of groupstartId
- - start stream idendId
- - end stream idcount
- - amount of messages- Returns:
- list
-
listPending
org.reactivestreams.Publisher<List<PendingEntry>> listPending(String groupName, String consumerName, StreamMessageId startId, StreamMessageId endId, int count)
Returns list of pending messages by group name and consumer name. Limited by start stream id and end stream id and count.StreamMessageId.MAX
is used as max stream idStreamMessageId.MIN
is used as min stream id- Parameters:
consumerName
- - name of consumergroupName
- - name of groupstartId
- - start stream idendId
- - end stream idcount
- - amount of messages- Returns:
- list
-
claim
org.reactivestreams.Publisher<Map<StreamMessageId,Map<K,V>>> claim(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 ids- Returns:
- stream data mapped by Stream ID
-
readGroup
org.reactivestreams.Publisher<Map<StreamMessageId,Map<K,V>>> readGroup(String groupName, String consumerName, StreamMessageId... ids)
Read stream data fromgroupName
byconsumerName
and specified collection of Stream IDs.- Parameters:
groupName
- - name of groupconsumerName
- - name of consumerids
- - collection of Stream IDs- Returns:
- stream data mapped by Stream ID
-
readGroup
org.reactivestreams.Publisher<Map<StreamMessageId,Map<K,V>>> readGroup(String groupName, String consumerName, int count, StreamMessageId... ids)
Read stream data fromgroupName
byconsumerName
and specified collection of Stream IDs.- Parameters:
groupName
- - name of groupconsumerName
- - consumer namecount
- - stream data size limitids
- - collection of Stream IDs- Returns:
- stream data mapped by Stream ID
-
readGroup
org.reactivestreams.Publisher<Map<StreamMessageId,Map<K,V>>> readGroup(String groupName, String consumerName, long timeout, TimeUnit unit, StreamMessageId... ids)
Read stream data fromgroupName
byconsumerName
and specified collection of Stream IDs. Wait for stream data availability for specifiedtimeout
interval.- Parameters:
groupName
- - name of groupconsumerName
- - consumer nametimeout
- - time interval to wait for stream data availabilityunit
- - time interval unitids
- - collection of Stream IDs- Returns:
- stream data mapped by Stream ID
-
readGroup
org.reactivestreams.Publisher<Map<StreamMessageId,Map<K,V>>> readGroup(String groupName, String consumerName, int count, long timeout, TimeUnit unit, StreamMessageId... ids)
Read stream data fromgroupName
byconsumerName
and specified collection of Stream IDs. Wait for stream data availability for specifiedtimeout
interval.- Parameters:
groupName
- - name of groupconsumerName
- - consumer namecount
- - stream data size limittimeout
- - time interval to wait for stream data availabilityunit
- - time interval unitids
- - collection of Stream IDs- Returns:
- stream data mapped by Stream ID
-
readGroup
org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>> readGroup(String groupName, String consumerName, StreamMessageId id, Map<String,StreamMessageId> nameToId)
Read stream data fromgroupName
byconsumerName
, starting by specified message ids for this and other streams.- Parameters:
groupName
- - name of groupconsumerName
- - name of consumerid
- - starting message id for this streamnameToId
- - Stream Message ID mapped by stream name- Returns:
- stream data mapped by key and Stream Message ID
-
readGroup
org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>> readGroup(String groupName, String consumerName, int count, StreamMessageId id, Map<String,StreamMessageId> nameToId)
Read stream data fromgroupName
byconsumerName
, starting by specified message ids for this and other streams.- Parameters:
groupName
- - name of groupconsumerName
- - name of consumercount
- - stream data size limitid
- - starting message id for this streamnameToId
- - Stream Message ID mapped by stream name- Returns:
- stream data mapped by key and Stream Message ID
-
readGroup
org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>> readGroup(String groupName, String consumerName, int count, long timeout, TimeUnit unit, StreamMessageId id, String key2, StreamMessageId id2)
Read stream data fromgroupName
byconsumerName
, starting by specified message ids for this and other streams. Waits for the first stream data availability for specifiedtimeout
interval.- Parameters:
groupName
- - name of groupconsumerName
- - name of consumercount
- - stream data size limittimeout
- - time interval to wait for stream data availabilityunit
- - time interval unitid
- - starting message id for this streamkey2
- - name of second streamid2
- - starting message id for second stream- Returns:
- stream data mapped by key and Stream Message ID
-
readGroup
org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>> readGroup(String groupName, String consumerName, int count, long timeout, TimeUnit unit, StreamMessageId id, String key2, StreamMessageId id2, String key3, StreamMessageId id3)
Read stream data fromgroupName
byconsumerName
, starting by specified message ids for this and other streams. Waits for the first stream data availability for specifiedtimeout
interval.- Parameters:
groupName
- - name of groupconsumerName
- - name of consumercount
- - stream data size limittimeout
- - time interval to wait for stream data availabilityunit
- - time interval unitid
- - starting message id for this streamkey2
- - name of second streamid2
- - starting message id for second streamkey3
- - name of third streamid3
- - starting message id for third stream- Returns:
- stream data mapped by key and Stream Message ID
-
readGroup
org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>> readGroup(String groupName, String consumerName, long timeout, TimeUnit unit, StreamMessageId id, Map<String,StreamMessageId> nameToId)
Read stream data fromgroupName
byconsumerName
, starting by specified message ids for this and other streams. Waits for the first stream data availability for specifiedtimeout
interval.- Parameters:
groupName
- - name of groupconsumerName
- - name of consumertimeout
- - time interval to wait for stream data availabilityunit
- - time interval unitid
- - starting message id for this streamnameToId
- - Stream Message ID mapped by stream name- Returns:
- stream data mapped by key and Stream Message ID
-
readGroup
org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>> readGroup(String groupName, String consumerName, StreamMessageId id, String key2, StreamMessageId id2)
Read stream data fromgroupName
byconsumerName
, starting by specified message ids for this and other streams.- Parameters:
groupName
- - name of groupconsumerName
- - name of consumerid
- - starting message id for this streamkey2
- - name of second streamid2
- - starting message id for second stream- Returns:
- stream data mapped by key and Stream Message ID
-
readGroup
org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>> readGroup(String groupName, String consumerName, StreamMessageId id, String key2, StreamMessageId id2, String key3, StreamMessageId id3)
Read stream data fromgroupName
byconsumerName
, starting by specified message ids for this and other streams.- Parameters:
groupName
- - name of groupconsumerName
- - name of consumerid
- - starting message id for this streamkey2
- - name of second streamid2
- - starting message id for second streamkey3
- - name of third streamid3
- - starting message id for third stream- Returns:
- stream data mapped by key and Stream Message ID
-
readGroup
org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>> readGroup(String groupName, String consumerName, int count, StreamMessageId id, String key2, StreamMessageId id2)
Read stream data fromgroupName
byconsumerName
, starting by specified message ids for this and other streams.- Parameters:
groupName
- - name of groupconsumerName
- - name of consumercount
- - stream data size limitid
- - starting message id for this streamkey2
- - name of second streamid2
- - starting message id for second stream- Returns:
- stream data mapped by key and Stream Message ID
-
readGroup
org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>> readGroup(String groupName, String consumerName, int count, StreamMessageId id, String key2, StreamMessageId id2, String key3, StreamMessageId id3)
Read stream data fromgroupName
byconsumerName
, starting by specified message ids for this and other streams.- Parameters:
groupName
- - name of groupconsumerName
- - name of consumercount
- - stream data size limitid
- - starting message id for this streamkey2
- - name of second streamid2
- - starting message id for second streamkey3
- - name of third streamid3
- - starting message id for third stream- Returns:
- stream data mapped by key and Stream Message ID
-
readGroup
org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>> readGroup(String groupName, String consumerName, long timeout, TimeUnit unit, StreamMessageId id, String key2, StreamMessageId id2)
Read stream data fromgroupName
byconsumerName
, starting by specified message ids for this and other streams. Waits for the first stream data availability for specifiedtimeout
interval.- Parameters:
groupName
- - name of groupconsumerName
- - name of consumertimeout
- - time interval to wait for stream data availabilityunit
- - time interval unitid
- - starting message id for this streamkey2
- - name of second streamid2
- - starting message id for second stream- Returns:
- stream data mapped by key and Stream Message ID
-
readGroup
org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>> readGroup(String groupName, String consumerName, long timeout, TimeUnit unit, StreamMessageId id, String key2, StreamMessageId id2, String key3, StreamMessageId id3)
Read stream data fromgroupName
byconsumerName
, starting by specified message ids for this and other streams. Waits for the first stream data availability for specifiedtimeout
interval.- Parameters:
groupName
- - name of groupconsumerName
- - name of consumertimeout
- - time interval to wait for stream data availabilityunit
- - time interval unitid
- - starting message id for this streamkey2
- - name of second streamid2
- - starting message id for second streamkey3
- - name of third streamid3
- - starting message id for third stream- Returns:
- stream data mapped by key and Stream Message ID
-
size
org.reactivestreams.Publisher<Long> size()
Returns number of entries in stream- Returns:
- size of stream
-
add
org.reactivestreams.Publisher<StreamMessageId> add(K key, V value)
Appends a new entry and returns generated Stream ID- Parameters:
key
- - key of entryvalue
- - value of entry- Returns:
- Stream ID
-
add
org.reactivestreams.Publisher<Void> add(StreamMessageId id, K key, V value)
Appends a new entry by specified Stream ID- Parameters:
id
- - Stream IDkey
- - key of entryvalue
- - value of entry- Returns:
- void
-
add
org.reactivestreams.Publisher<StreamMessageId> add(K key, V value, int trimLen, boolean trimStrict)
Appends a new entry and returns generated Stream ID. Trims stream to a specifiedtrimLen
size. IftrimStrict
isfalse
then trims to few tens of entries more than specified length to trim.- Parameters:
key
- - key of entryvalue
- - value of entrytrimLen
- - length to trimtrimStrict
- - iffalse
then trims to few tens of entries more than specified length to trim- Returns:
- Stream ID
-
add
org.reactivestreams.Publisher<Void> add(StreamMessageId id, K key, V value, int trimLen, boolean trimStrict)
Appends a new entry by specified Stream ID. Trims stream to a specifiedtrimLen
size. IftrimStrict
isfalse
then trims to few tens of entries more than specified length to trim.- Parameters:
id
- - Stream IDkey
- - key of entryvalue
- - value of entrytrimLen
- - length to trimtrimStrict
- - iffalse
then trims to few tens of entries more than specified length to trim- Returns:
- void
-
addAll
org.reactivestreams.Publisher<StreamMessageId> addAll(Map<K,V> entries)
Appends new entries and returns generated Stream ID- Parameters:
entries
- - entries to add- Returns:
- Stream ID
-
addAll
org.reactivestreams.Publisher<Void> addAll(StreamMessageId id, Map<K,V> entries)
Appends new entries by specified Stream ID- Parameters:
id
- - Stream IDentries
- - entries to add- Returns:
- void
-
addAll
org.reactivestreams.Publisher<StreamMessageId> addAll(Map<K,V> entries, int trimLen, boolean trimStrict)
Appends new entries and returns generated Stream ID. Trims stream to a specifiedtrimLen
size. IftrimStrict
isfalse
then trims to few tens of entries more than specified length to trim.- Parameters:
entries
- - entries to addtrimLen
- - length to trimtrimStrict
- - iffalse
then trims to few tens of entries more than specified length to trim- Returns:
- Stream ID
-
addAll
org.reactivestreams.Publisher<Void> addAll(StreamMessageId id, Map<K,V> entries, int trimLen, boolean trimStrict)
Appends new entries by specified Stream ID. Trims stream to a specifiedtrimLen
size. IftrimStrict
isfalse
then trims to few tens of entries more than specified length to trim.- Parameters:
id
- - Stream IDentries
- - entries to addtrimLen
- - length to trimtrimStrict
- - iffalse
then trims to few tens of entries more than specified length to trim- Returns:
- void
-
read
org.reactivestreams.Publisher<Map<StreamMessageId,Map<K,V>>> read(StreamMessageId... ids)
Read stream data by specified collection of Stream IDs.- Parameters:
ids
- - collection of Stream IDs- Returns:
- stream data mapped by Stream ID
-
read
org.reactivestreams.Publisher<Map<StreamMessageId,Map<K,V>>> read(int count, StreamMessageId... ids)
Read stream data by specified collection of Stream IDs.- Parameters:
count
- - stream data size limitids
- - collection of Stream IDs- Returns:
- stream data mapped by Stream ID
-
read
org.reactivestreams.Publisher<Map<StreamMessageId,Map<K,V>>> read(long timeout, TimeUnit unit, StreamMessageId... ids)
Read stream data by specified collection of Stream IDs. Wait for stream data availability for specifiedtimeout
interval.- Parameters:
timeout
- - time interval to wait for stream data availabilityunit
- - time interval unitids
- - collection of Stream IDs- Returns:
- stream data mapped by Stream ID
-
read
org.reactivestreams.Publisher<Map<StreamMessageId,Map<K,V>>> read(int count, long timeout, TimeUnit unit, StreamMessageId... ids)
Read stream data by specified collection of Stream IDs. Wait for stream data availability for specifiedtimeout
interval.- Parameters:
count
- - stream data size limittimeout
- - time interval to wait for stream data availabilityunit
- - time interval unitids
- - collection of Stream IDs- Returns:
- stream data mapped by Stream ID
-
read
org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>> read(StreamMessageId id, String name2, StreamMessageId id2)
Read stream data by specified stream name including this stream.- Parameters:
id
- - id of this streamname2
- - name of second streamid2
- - id of second stream- Returns:
- stream data mapped by key and Stream ID
-
read
org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>> read(StreamMessageId id, String name2, StreamMessageId id2, String name3, StreamMessageId id3)
Read stream data by specified stream names including this stream.- Parameters:
id
- - id of this streamname2
- - name of second streamid2
- - id of second streamname3
- - name of third streamid3
- - id of third stream- Returns:
- stream data mapped by key and Stream ID
-
read
org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>> read(StreamMessageId id, Map<String,StreamMessageId> nameToId)
Read stream data by specified stream id mapped by name including this stream.- Parameters:
id
- - id of this streamnameToId
- - stream id mapped by name- Returns:
- stream data mapped by key and Stream ID
-
read
org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>> read(int count, StreamMessageId id, String name2, StreamMessageId id2)
Read stream data by specified stream name including this stream.- Parameters:
count
- - stream data size limitid
- - id of this streamname2
- - name of second streamid2
- - id of second stream- Returns:
- stream data mapped by key and Stream ID
-
read
org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>> read(int count, StreamMessageId id, String name2, StreamMessageId id2, String name3, StreamMessageId id3)
Read stream data by specified stream names including this stream.- Parameters:
count
- - stream data size limitid
- - id of this streamname2
- - name of second streamid2
- - id of second streamname3
- - name of third streamid3
- - id of third stream- Returns:
- stream data mapped by key and Stream ID
-
read
org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>> read(int count, StreamMessageId id, Map<String,StreamMessageId> nameToId)
Read stream data by specified stream id mapped by name including this stream.- Parameters:
count
- - stream data size limitid
- - id of this streamnameToId
- - stream id mapped by name- Returns:
- stream data mapped by key and Stream ID
-
read
org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>> read(long timeout, TimeUnit unit, StreamMessageId id, String name2, StreamMessageId id2)
Read stream data by specified stream name including this stream. Wait for the first stream data availability for specifiedtimeout
interval.- Parameters:
timeout
- - time interval to wait for stream data availabilityunit
- - time interval unitid
- - id of this streamname2
- - name of second streamid2
- - id of second stream- Returns:
- stream data mapped by key and Stream ID
-
read
org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>> read(long timeout, TimeUnit unit, StreamMessageId id, String name2, StreamMessageId id2, String name3, StreamMessageId id3)
Read stream data by specified stream names including this stream. Wait for the first stream data availability for specifiedtimeout
interval.- Parameters:
timeout
- - time interval to wait for stream data availabilityunit
- - time interval unitid
- - id of this streamname2
- - name of second streamid2
- - id of second streamname3
- - name of third streamid3
- - id of third stream- Returns:
- stream data mapped by key and Stream ID
-
read
org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>> read(long timeout, TimeUnit unit, StreamMessageId id, Map<String,StreamMessageId> nameToId)
Read stream data by specified stream id mapped by name including this stream. Wait for the first stream data availability for specifiedtimeout
interval.- Parameters:
timeout
- - time interval to wait for stream data availabilityunit
- - time interval unitid
- - id of this streamnameToId
- - stream id mapped by name- Returns:
- stream data mapped by key and Stream ID
-
read
org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>> read(int count, long timeout, TimeUnit unit, StreamMessageId id, String name2, StreamMessageId id2)
Read stream data by specified stream name including this stream. Wait for the first stream data availability for specifiedtimeout
interval.- Parameters:
count
- - stream data size limittimeout
- - time interval to wait for stream data availabilityunit
- - time interval unitid
- - id of this streamname2
- - name of second streamid2
- - id of second stream- Returns:
- stream data mapped by key and Stream ID
-
read
org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>> read(int count, long timeout, TimeUnit unit, StreamMessageId id, String name2, StreamMessageId id2, String name3, StreamMessageId id3)
Read stream data by specified stream names including this stream. Wait for the first stream data availability for specifiedtimeout
interval.- Parameters:
count
- - stream data size limittimeout
- - time interval to wait for stream data availabilityunit
- - time interval unitid
- - id of this streamname2
- - name of second streamid2
- - id of second streamname3
- - name of third streamid3
- - id of third stream- Returns:
- stream data mapped by key and Stream ID
-
read
org.reactivestreams.Publisher<Map<String,Map<StreamMessageId,Map<K,V>>>> read(int count, long timeout, TimeUnit unit, StreamMessageId id, Map<String,StreamMessageId> nameToId)
Read stream data by specified stream id mapped by name including this stream. Wait for the first stream data availability for specifiedtimeout
interval.- Parameters:
count
- - stream data size limittimeout
- - time interval to wait for stream data availabilityunit
- - time interval unitid
- - id of this streamnameToId
- - stream id mapped by name- Returns:
- stream data mapped by key and Stream ID
-
range
org.reactivestreams.Publisher<Map<StreamMessageId,Map<K,V>>> range(StreamMessageId startId, StreamMessageId endId)
Read 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
-
range
org.reactivestreams.Publisher<Map<StreamMessageId,Map<K,V>>> range(int count, StreamMessageId startId, StreamMessageId endId)
Read 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
-
rangeReversed
org.reactivestreams.Publisher<Map<StreamMessageId,Map<K,V>>> rangeReversed(StreamMessageId startId, StreamMessageId endId)
Read 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
-
rangeReversed
org.reactivestreams.Publisher<Map<StreamMessageId,Map<K,V>>> rangeReversed(int count, StreamMessageId startId, StreamMessageId endId)
Read 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
-
remove
org.reactivestreams.Publisher<Long> remove(StreamMessageId... ids)
Removes messages by id.- Parameters:
ids
- - id of messages to remove- Returns:
- deleted messages amount
-
trim
org.reactivestreams.Publisher<Long> trim(int size)
Trims stream to specified size- Parameters:
size
- - new size of stream- Returns:
- number of deleted messages
-
trimNonStrict
org.reactivestreams.Publisher<Long> trimNonStrict(int size)
Trims stream to few tens of entries more than specified length to trim.- Parameters:
size
- - new size of stream- Returns:
- number of deleted messages
-
-