Interface RStreamRx<K,V>
-
- Type Parameters:
K
- key typeV
- value type
- All Superinterfaces:
RExpirableRx
,RObjectRx
public interface RStreamRx<K,V> extends RExpirableRx
Reactive 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 io.reactivex.rxjava3.core.Single<Long>
ack(String groupName, StreamMessageId... ids)
Marks pending messages by group name and streamids
as correctly processed.io.reactivex.rxjava3.core.Single<StreamMessageId>
add(K key, V value)
Deprecated.io.reactivex.rxjava3.core.Single<StreamMessageId>
add(K key, V value, int trimLen, boolean trimStrict)
Deprecated.io.reactivex.rxjava3.core.Single<StreamMessageId>
add(StreamAddArgs<K,V> args)
Appends a new entry/entries and returns generated Stream Message IDio.reactivex.rxjava3.core.Completable
add(StreamMessageId id, K key, V value)
Deprecated.io.reactivex.rxjava3.core.Completable
add(StreamMessageId id, K key, V value, int trimLen, boolean trimStrict)
Deprecated.io.reactivex.rxjava3.core.Completable
add(StreamMessageId id, StreamAddArgs<K,V> args)
Appends a new entry/entries by specified Stream Message IDio.reactivex.rxjava3.core.Single<StreamMessageId>
addAll(Map<K,V> entries)
Deprecated.io.reactivex.rxjava3.core.Single<StreamMessageId>
addAll(Map<K,V> entries, int trimLen, boolean trimStrict)
Deprecated.io.reactivex.rxjava3.core.Completable
addAll(StreamMessageId id, Map<K,V> entries)
Deprecated.io.reactivex.rxjava3.core.Completable
addAll(StreamMessageId id, Map<K,V> entries, int trimLen, boolean trimStrict)
Deprecated.io.reactivex.rxjava3.core.Single<AutoClaimResult<K,V>>
autoClaim(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.io.reactivex.rxjava3.core.Single<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.io.reactivex.rxjava3.core.Completable
createConsumer(String groupName, String consumerName)
Creates consumer of the group by name.io.reactivex.rxjava3.core.Completable
createGroup(String groupName)
Creates consumer group by name.io.reactivex.rxjava3.core.Completable
createGroup(String groupName, StreamMessageId id)
Creates consumer group by name and stream id.io.reactivex.rxjava3.core.Single<FastAutoClaimResult>
fastAutoClaim(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.io.reactivex.rxjava3.core.Single<StreamInfo<K,V>>
getInfo()
Returns information about this stream.io.reactivex.rxjava3.core.Single<PendingResult>
getPendingInfo(String groupName)
Returns common info about pending messages by group name.io.reactivex.rxjava3.core.Single<List<StreamConsumer>>
listConsumers(String groupName)
Returns list of objects with information about group customers for specifiedgroupName
.io.reactivex.rxjava3.core.Single<List<StreamGroup>>
listGroups()
Returns list of objects with information about groups belonging to this stream.io.reactivex.rxjava3.core.Single<PendingResult>
listPending(String groupName)
Deprecated.io.reactivex.rxjava3.core.Single<List<PendingEntry>>
listPending(String groupName, String consumerName, StreamMessageId startId, StreamMessageId endId, int count)
Returns list of pending messages by group name and consumer name.io.reactivex.rxjava3.core.Single<List<PendingEntry>>
listPending(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.io.reactivex.rxjava3.core.Single<List<PendingEntry>>
listPending(String groupName, StreamMessageId startId, StreamMessageId endId, int count)
Returns list of pending messages by group name.io.reactivex.rxjava3.core.Single<List<PendingEntry>>
listPending(String groupName, StreamMessageId startId, StreamMessageId endId, long idleTime, TimeUnit idleTimeUnit, int count)
Returns list of common info about pending messages by group name.io.reactivex.rxjava3.core.Single<Map<StreamMessageId,Map<K,V>>>
pendingRange(String groupName, String consumerName, StreamMessageId startId, StreamMessageId endId, int count)
Returns stream data of pending messages by group and customer name.io.reactivex.rxjava3.core.Single<Map<StreamMessageId,Map<K,V>>>
pendingRange(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.io.reactivex.rxjava3.core.Single<Map<StreamMessageId,Map<K,V>>>
pendingRange(String groupName, StreamMessageId startId, StreamMessageId endId, int count)
Returns stream data of pending messages by group name.io.reactivex.rxjava3.core.Single<Map<StreamMessageId,Map<K,V>>>
pendingRange(String groupName, StreamMessageId startId, StreamMessageId endId, long idleTime, TimeUnit idleTimeUnit, int count)
Returns stream data of pending messages by group name.io.reactivex.rxjava3.core.Single<Map<StreamMessageId,Map<K,V>>>
range(int count, StreamMessageId startId, StreamMessageId endId)
Returns stream data in range by specified start Stream ID (included) and end Stream ID (included).io.reactivex.rxjava3.core.Single<Map<StreamMessageId,Map<K,V>>>
range(StreamMessageId startId, StreamMessageId endId)
Returns stream data in range by specified start Stream ID (included) and end Stream ID (included).io.reactivex.rxjava3.core.Single<Map<StreamMessageId,Map<K,V>>>
rangeReversed(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).io.reactivex.rxjava3.core.Single<Map<StreamMessageId,Map<K,V>>>
rangeReversed(StreamMessageId startId, StreamMessageId endId)
Returns stream data in reverse order in range by specified start Stream ID (included) and end Stream ID (included).io.reactivex.rxjava3.core.Single<Map<StreamMessageId,Map<K,V>>>
read(int count, long timeout, TimeUnit unit, StreamMessageId... ids)
Deprecated.io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>>
read(int count, long timeout, TimeUnit unit, StreamMessageId id, String name2, StreamMessageId id2)
Deprecated.io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>>
read(int count, long timeout, TimeUnit unit, StreamMessageId id, String name2, StreamMessageId id2, String name3, StreamMessageId id3)
Deprecated.io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>>
read(int count, long timeout, TimeUnit unit, StreamMessageId id, Map<String,StreamMessageId> nameToId)
Deprecated.io.reactivex.rxjava3.core.Single<Map<StreamMessageId,Map<K,V>>>
read(int count, StreamMessageId... ids)
Deprecated.io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>>
read(int count, StreamMessageId id, String name2, StreamMessageId id2)
Deprecated.io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>>
read(int count, StreamMessageId id, String name2, StreamMessageId id2, String name3, StreamMessageId id3)
Deprecated.io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>>
read(int count, StreamMessageId id, Map<String,StreamMessageId> nameToId)
Deprecated.io.reactivex.rxjava3.core.Single<Map<StreamMessageId,Map<K,V>>>
read(long timeout, TimeUnit unit, StreamMessageId... ids)
Deprecated.io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>>
read(long timeout, TimeUnit unit, StreamMessageId id, String name2, StreamMessageId id2)
Deprecated.io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>>
read(long timeout, TimeUnit unit, StreamMessageId id, String name2, StreamMessageId id2, String name3, StreamMessageId id3)
Deprecated.io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>>
read(long timeout, TimeUnit unit, StreamMessageId id, Map<String,StreamMessageId> nameToId)
Deprecated.io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>>
read(StreamMultiReadArgs args)
Read stream data from multiple streams including current.io.reactivex.rxjava3.core.Single<Map<StreamMessageId,Map<K,V>>>
read(StreamReadArgs args)
Read stream data from current stream only.io.reactivex.rxjava3.core.Single<Map<StreamMessageId,Map<K,V>>>
read(StreamMessageId... ids)
Deprecated.io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>>
read(StreamMessageId id, String name2, StreamMessageId id2)
Deprecated.io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>>
read(StreamMessageId id, String name2, StreamMessageId id2, String name3, StreamMessageId id3)
Deprecated.io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>>
read(StreamMessageId id, Map<String,StreamMessageId> nameToId)
Deprecated.io.reactivex.rxjava3.core.Single<Map<StreamMessageId,Map<K,V>>>
readGroup(String groupName, String consumerName, int count, long timeout, TimeUnit unit, StreamMessageId... ids)
Deprecated.io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>>
readGroup(String groupName, String consumerName, int count, long timeout, TimeUnit unit, StreamMessageId id, String key2, StreamMessageId id2)
Deprecated.io.reactivex.rxjava3.core.Single<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)
Deprecated.io.reactivex.rxjava3.core.Single<Map<StreamMessageId,Map<K,V>>>
readGroup(String groupName, String consumerName, int count, StreamMessageId... ids)
Deprecated.io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>>
readGroup(String groupName, String consumerName, int count, StreamMessageId id, String key2, StreamMessageId id2)
Deprecated.io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>>
readGroup(String groupName, String consumerName, int count, StreamMessageId id, String key2, StreamMessageId id2, String key3, StreamMessageId id3)
Deprecated.io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>>
readGroup(String groupName, String consumerName, int count, StreamMessageId id, Map<String,StreamMessageId> nameToId)
Deprecated.io.reactivex.rxjava3.core.Single<Map<StreamMessageId,Map<K,V>>>
readGroup(String groupName, String consumerName, long timeout, TimeUnit unit, StreamMessageId... ids)
Deprecated.io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>>
readGroup(String groupName, String consumerName, long timeout, TimeUnit unit, StreamMessageId id, String key2, StreamMessageId id2)
Deprecated.io.reactivex.rxjava3.core.Single<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)
Deprecated.io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>>
readGroup(String groupName, String consumerName, long timeout, TimeUnit unit, StreamMessageId id, Map<String,StreamMessageId> nameToId)
Deprecated.io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>>
readGroup(String groupName, String consumerName, StreamMultiReadGroupArgs args)
Read stream data from consumer group and multiple streams including current.io.reactivex.rxjava3.core.Single<Map<StreamMessageId,Map<K,V>>>
readGroup(String groupName, String consumerName, StreamReadGroupArgs args)
Read stream data from consumer group and current stream only.io.reactivex.rxjava3.core.Single<Map<StreamMessageId,Map<K,V>>>
readGroup(String groupName, String consumerName, StreamMessageId... ids)
Deprecated.io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>>
readGroup(String groupName, String consumerName, StreamMessageId id, String key2, StreamMessageId id2)
Deprecated.io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>>
readGroup(String groupName, String consumerName, StreamMessageId id, String key2, StreamMessageId id2, String key3, StreamMessageId id3)
Deprecated.io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>>
readGroup(String groupName, String consumerName, StreamMessageId id, Map<String,StreamMessageId> nameToId)
Deprecated.io.reactivex.rxjava3.core.Single<Long>
remove(StreamMessageId... ids)
Removes messages by id.io.reactivex.rxjava3.core.Single<Long>
removeConsumer(String groupName, String consumerName)
Removes consumer of the group by name.io.reactivex.rxjava3.core.Completable
removeGroup(String groupName)
Removes group by name.io.reactivex.rxjava3.core.Single<Long>
size()
Returns number of entries in streamio.reactivex.rxjava3.core.Single<Long>
trim(int size)
Trims stream to specified sizeio.reactivex.rxjava3.core.Single<Long>
trim(TrimStrategy strategy, int threshold)
Trims stream to specified sizeio.reactivex.rxjava3.core.Single<Long>
trimNonStrict(int size)
Trims stream to few tens of entries more than specified length to trim.io.reactivex.rxjava3.core.Single<Long>
trimNonStrict(TrimStrategy strategy, int threshold)
Trims stream using almost exact trimming threshold.io.reactivex.rxjava3.core.Single<Long>
trimNonStrict(TrimStrategy strategy, int threshold, int limit)
Trims stream using almost exact trimming threshold up to limit.io.reactivex.rxjava3.core.Completable
updateGroupMessageId(String groupName, StreamMessageId id)
Updates next message id delivered to consumers.-
Methods inherited from interface org.redisson.api.RExpirableRx
clearExpire, expire, expireAt, expireAt, expireAt, remainTimeToLive
-
Methods inherited from interface org.redisson.api.RObjectRx
addListener, copy, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
-
-
-
-
Method Detail
-
createGroup
io.reactivex.rxjava3.core.Completable createGroup(String groupName)
Creates consumer group by name.- Parameters:
groupName
- - name of group- Returns:
- void
-
createGroup
io.reactivex.rxjava3.core.Completable 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
io.reactivex.rxjava3.core.Completable removeGroup(String groupName)
Removes group by name.- Parameters:
groupName
- - name of group- Returns:
- void
-
createConsumer
io.reactivex.rxjava3.core.Completable createConsumer(String groupName, String consumerName)
Creates consumer of the group by name.Requires Redis 6.2.0 and higher.
- Parameters:
groupName
- - name of groupconsumerName
- - name of consumer
-
removeConsumer
io.reactivex.rxjava3.core.Single<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
io.reactivex.rxjava3.core.Completable updateGroupMessageId(String groupName, StreamMessageId id)
Updates next message id delivered to consumers.- Parameters:
groupName
- - name of groupid
- - Stream Message ID- Returns:
- void
-
ack
io.reactivex.rxjava3.core.Single<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
-
getPendingInfo
io.reactivex.rxjava3.core.Single<PendingResult> getPendingInfo(String groupName)
Returns common info about pending messages by group name.- Parameters:
groupName
- - name of group- Returns:
- result object
-
listPending
@Deprecated io.reactivex.rxjava3.core.Single<PendingResult> listPending(String groupName)
Deprecated.
-
listPending
io.reactivex.rxjava3.core.Single<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
io.reactivex.rxjava3.core.Single<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
-
listPending
io.reactivex.rxjava3.core.Single<List<PendingEntry>> listPending(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 IDidleTime
- - minimum idle time of messagesidleTimeUnit
- - idle time unitendId
- - end Stream Message IDcount
- - amount of messages- Returns:
- list
- See Also:
pendingRange(java.lang.String, org.redisson.api.StreamMessageId, org.redisson.api.StreamMessageId, long, java.util.concurrent.TimeUnit, int)
-
listPending
io.reactivex.rxjava3.core.Single<List<PendingEntry>> listPending(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:
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:
- list
- See Also:
pendingRange(java.lang.String, org.redisson.api.StreamMessageId, org.redisson.api.StreamMessageId, long, java.util.concurrent.TimeUnit, int)
-
pendingRange
io.reactivex.rxjava3.core.Single<Map<StreamMessageId,Map<K,V>>> pendingRange(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:
listPending(java.lang.String)
-
pendingRange
io.reactivex.rxjava3.core.Single<Map<StreamMessageId,Map<K,V>>> pendingRange(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:
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:
listPending(java.lang.String)
-
claim
io.reactivex.rxjava3.core.Single<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
-
autoClaim
io.reactivex.rxjava3.core.Single<AutoClaimResult<K,V>> autoClaim(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
-
fastAutoClaim
io.reactivex.rxjava3.core.Single<FastAutoClaimResult> fastAutoClaim(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
-
readGroup
io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>> readGroup(String groupName, String 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
io.reactivex.rxjava3.core.Single<Map<StreamMessageId,Map<K,V>>> readGroup(String groupName, String 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
@Deprecated io.reactivex.rxjava3.core.Single<Map<StreamMessageId,Map<K,V>>> readGroup(String groupName, String consumerName, StreamMessageId... ids)
Deprecated.
-
readGroup
@Deprecated io.reactivex.rxjava3.core.Single<Map<StreamMessageId,Map<K,V>>> readGroup(String groupName, String consumerName, int count, StreamMessageId... ids)
Deprecated.
-
readGroup
@Deprecated io.reactivex.rxjava3.core.Single<Map<StreamMessageId,Map<K,V>>> readGroup(String groupName, String consumerName, long timeout, TimeUnit unit, StreamMessageId... ids)
Deprecated.
-
readGroup
@Deprecated io.reactivex.rxjava3.core.Single<Map<StreamMessageId,Map<K,V>>> readGroup(String groupName, String consumerName, int count, long timeout, TimeUnit unit, StreamMessageId... ids)
Deprecated.
-
readGroup
@Deprecated io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>> readGroup(String groupName, String consumerName, StreamMessageId id, Map<String,StreamMessageId> nameToId)
Deprecated.
-
readGroup
@Deprecated io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>> readGroup(String groupName, String consumerName, int count, StreamMessageId id, Map<String,StreamMessageId> nameToId)
Deprecated.
-
readGroup
@Deprecated io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>> readGroup(String groupName, String consumerName, int count, long timeout, TimeUnit unit, StreamMessageId id, String key2, StreamMessageId id2)
Deprecated.
-
readGroup
@Deprecated io.reactivex.rxjava3.core.Single<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)
Deprecated.
-
readGroup
@Deprecated io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>> readGroup(String groupName, String consumerName, long timeout, TimeUnit unit, StreamMessageId id, Map<String,StreamMessageId> nameToId)
Deprecated.
-
readGroup
@Deprecated io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>> readGroup(String groupName, String consumerName, StreamMessageId id, String key2, StreamMessageId id2)
Deprecated.
-
readGroup
@Deprecated io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>> readGroup(String groupName, String consumerName, StreamMessageId id, String key2, StreamMessageId id2, String key3, StreamMessageId id3)
Deprecated.
-
readGroup
@Deprecated io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>> readGroup(String groupName, String consumerName, int count, StreamMessageId id, String key2, StreamMessageId id2)
Deprecated.
-
readGroup
@Deprecated io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>> readGroup(String groupName, String consumerName, int count, StreamMessageId id, String key2, StreamMessageId id2, String key3, StreamMessageId id3)
Deprecated.
-
readGroup
@Deprecated io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>> readGroup(String groupName, String consumerName, long timeout, TimeUnit unit, StreamMessageId id, String key2, StreamMessageId id2)
Deprecated.
-
readGroup
@Deprecated io.reactivex.rxjava3.core.Single<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)
Deprecated.
-
size
io.reactivex.rxjava3.core.Single<Long> size()
Returns number of entries in stream- Returns:
- size of stream
-
add
io.reactivex.rxjava3.core.Single<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
io.reactivex.rxjava3.core.Completable 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
@Deprecated io.reactivex.rxjava3.core.Single<StreamMessageId> add(K key, V value)
Deprecated.
-
add
@Deprecated io.reactivex.rxjava3.core.Completable add(StreamMessageId id, K key, V value)
Deprecated.
-
add
@Deprecated io.reactivex.rxjava3.core.Single<StreamMessageId> add(K key, V value, int trimLen, boolean trimStrict)
Deprecated.
-
add
@Deprecated io.reactivex.rxjava3.core.Completable add(StreamMessageId id, K key, V value, int trimLen, boolean trimStrict)
Deprecated.
-
addAll
@Deprecated io.reactivex.rxjava3.core.Single<StreamMessageId> addAll(Map<K,V> entries)
Deprecated.
-
addAll
@Deprecated io.reactivex.rxjava3.core.Completable addAll(StreamMessageId id, Map<K,V> entries)
Deprecated.
-
addAll
@Deprecated io.reactivex.rxjava3.core.Single<StreamMessageId> addAll(Map<K,V> entries, int trimLen, boolean trimStrict)
Deprecated.
-
addAll
@Deprecated io.reactivex.rxjava3.core.Completable addAll(StreamMessageId id, Map<K,V> entries, int trimLen, boolean trimStrict)
Deprecated.
-
read
io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<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
io.reactivex.rxjava3.core.Single<Map<StreamMessageId,Map<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
@Deprecated io.reactivex.rxjava3.core.Single<Map<StreamMessageId,Map<K,V>>> read(StreamMessageId... ids)
Deprecated.
-
read
@Deprecated io.reactivex.rxjava3.core.Single<Map<StreamMessageId,Map<K,V>>> read(int count, StreamMessageId... ids)
Deprecated.
-
read
@Deprecated io.reactivex.rxjava3.core.Single<Map<StreamMessageId,Map<K,V>>> read(long timeout, TimeUnit unit, StreamMessageId... ids)
Deprecated.
-
read
@Deprecated io.reactivex.rxjava3.core.Single<Map<StreamMessageId,Map<K,V>>> read(int count, long timeout, TimeUnit unit, StreamMessageId... ids)
Deprecated.
-
read
@Deprecated io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>> read(StreamMessageId id, String name2, StreamMessageId id2)
Deprecated.
-
read
@Deprecated io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>> read(StreamMessageId id, String name2, StreamMessageId id2, String name3, StreamMessageId id3)
Deprecated.
-
read
@Deprecated io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>> read(StreamMessageId id, Map<String,StreamMessageId> nameToId)
Deprecated.
-
read
@Deprecated io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>> read(int count, StreamMessageId id, String name2, StreamMessageId id2)
Deprecated.
-
read
@Deprecated io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>> read(int count, StreamMessageId id, String name2, StreamMessageId id2, String name3, StreamMessageId id3)
Deprecated.
-
read
@Deprecated io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>> read(int count, StreamMessageId id, Map<String,StreamMessageId> nameToId)
Deprecated.
-
read
@Deprecated io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>> read(long timeout, TimeUnit unit, StreamMessageId id, String name2, StreamMessageId id2)
Deprecated.
-
read
@Deprecated io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>> read(long timeout, TimeUnit unit, StreamMessageId id, String name2, StreamMessageId id2, String name3, StreamMessageId id3)
Deprecated.
-
read
@Deprecated io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>> read(long timeout, TimeUnit unit, StreamMessageId id, Map<String,StreamMessageId> nameToId)
Deprecated.
-
read
@Deprecated io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>> read(int count, long timeout, TimeUnit unit, StreamMessageId id, String name2, StreamMessageId id2)
Deprecated.
-
read
@Deprecated io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>> read(int count, long timeout, TimeUnit unit, StreamMessageId id, String name2, StreamMessageId id2, String name3, StreamMessageId id3)
Deprecated.
-
read
@Deprecated io.reactivex.rxjava3.core.Single<Map<String,Map<StreamMessageId,Map<K,V>>>> read(int count, long timeout, TimeUnit unit, StreamMessageId id, Map<String,StreamMessageId> nameToId)
Deprecated.
-
range
io.reactivex.rxjava3.core.Single<Map<StreamMessageId,Map<K,V>>> range(StreamMessageId startId, StreamMessageId endId)
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
-
range
io.reactivex.rxjava3.core.Single<Map<StreamMessageId,Map<K,V>>> range(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
-
rangeReversed
io.reactivex.rxjava3.core.Single<Map<StreamMessageId,Map<K,V>>> rangeReversed(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
-
rangeReversed
io.reactivex.rxjava3.core.Single<Map<StreamMessageId,Map<K,V>>> rangeReversed(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
-
remove
io.reactivex.rxjava3.core.Single<Long> remove(StreamMessageId... ids)
Removes messages by id.- Parameters:
ids
- - id of messages to remove- Returns:
- deleted messages amount
-
trim
io.reactivex.rxjava3.core.Single<Long> trim(int size)
Trims stream to specified size- Parameters:
size
- - new size of stream- Returns:
- number of deleted messages
-
trimNonStrict
io.reactivex.rxjava3.core.Single<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
-
trim
io.reactivex.rxjava3.core.Single<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
io.reactivex.rxjava3.core.Single<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
io.reactivex.rxjava3.core.Single<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
io.reactivex.rxjava3.core.Single<StreamInfo<K,V>> getInfo()
Returns information about this stream.- Returns:
- info object
-
listGroups
io.reactivex.rxjava3.core.Single<List<StreamGroup>> listGroups()
Returns list of objects with information about groups belonging to this stream.- Returns:
- list of info objects
-
listConsumers
io.reactivex.rxjava3.core.Single<List<StreamConsumer>> listConsumers(String groupName)
Returns list of objects with information about group customers for specifiedgroupName
.- Parameters:
groupName
- - name of group- Returns:
- list of info objects
-
pendingRange
io.reactivex.rxjava3.core.Single<Map<StreamMessageId,Map<K,V>>> pendingRange(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:
listPending(java.lang.String)
-
pendingRange
io.reactivex.rxjava3.core.Single<Map<StreamMessageId,Map<K,V>>> pendingRange(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:
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)
-
-