Class BlockingStreamCommandsImpl<K,F,V>
- java.lang.Object
-
- io.quarkus.redis.runtime.datasource.AbstractRedisCommandGroup
-
- io.quarkus.redis.runtime.datasource.BlockingStreamCommandsImpl<K,F,V>
-
- All Implemented Interfaces:
RedisCommands
,StreamCommands<K,F,V>
public class BlockingStreamCommandsImpl<K,F,V> extends AbstractRedisCommandGroup implements StreamCommands<K,F,V>
-
-
Field Summary
-
Fields inherited from class io.quarkus.redis.runtime.datasource.AbstractRedisCommandGroup
ds, timeout
-
-
Constructor Summary
Constructors Constructor Description BlockingStreamCommandsImpl(RedisDataSource ds, ReactiveStreamCommands<K,F,V> reactive, Duration timeout)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
xack(K key, String group, String... ids)
Execute the command XACK.String
xadd(K key, XAddArgs args, Map<F,V> payload)
Execute the command XADD.String
xadd(K key, Map<F,V> payload)
Execute the command XADD.ClaimedMessages<K,F,V>
xautoclaim(K key, String group, String consumer, Duration minIdleTime, String start)
Execute the command XAUTOCLAIM.ClaimedMessages<K,F,V>
xautoclaim(K key, String group, String consumer, Duration minIdleTime, String start, int count)
Execute the command XAUTOCLAIM.ClaimedMessages<K,F,V>
xautoclaim(K key, String group, String consumer, Duration minIdleTime, String start, int count, boolean justId)
Execute the command XAUTOCLAIM.List<StreamMessage<K,F,V>>
xclaim(K key, String group, String consumer, Duration minIdleTime, XClaimArgs args, String... id)
Execute the command XCLAIM.List<StreamMessage<K,F,V>>
xclaim(K key, String group, String consumer, Duration minIdleTime, String... id)
Execute the command XCLAIM.int
xdel(K key, String... id)
Execute the command XDEL.void
xgroupCreate(K key, String groupname, String from)
Execute the command XGROUP CREATE.void
xgroupCreate(K key, String groupname, String from, XGroupCreateArgs args)
Execute the command XGROUP CREATE.boolean
xgroupCreateConsumer(K key, String groupname, String consumername)
Execute the command XGROUP CREATECONSUMER.long
xgroupDelConsumer(K key, String groupname, String consumername)
Execute the command XGROUP DELCONSUMER.boolean
xgroupDestroy(K key, String groupname)
Execute the command XGROUP DESTROY.void
xgroupSetId(K key, String groupname, String from)
Execute the command XGROUP SETID.void
xgroupSetId(K key, String groupname, String from, XGroupSetIdArgs args)
Execute the command XGROUP SETID.long
xlen(K key)
Execute the command XLEN.XPendingSummary
xpending(K key, String group)
Execute the command XPENDING.List<PendingMessage>
xpending(K key, String group, StreamRange range, int count)
Execute the command XPENDING.List<PendingMessage>
xpending(K key, String group, StreamRange range, int count, XPendingArgs args)
Execute the command XPENDING.List<StreamMessage<K,F,V>>
xrange(K key, StreamRange range)
Execute the command XRANGE.List<StreamMessage<K,F,V>>
xrange(K key, StreamRange range, int count)
Execute the command XRANGE.List<StreamMessage<K,F,V>>
xread(Map<K,String> lastIdsPerStream)
Execute the command XREAD.List<StreamMessage<K,F,V>>
xread(Map<K,String> lastIdsPerStream, XReadArgs args)
Execute the command XREAD.List<StreamMessage<K,F,V>>
xread(K key, String id)
Execute the command XREAD.List<StreamMessage<K,F,V>>
xread(K key, String id, XReadArgs args)
Execute the command XREAD.List<StreamMessage<K,F,V>>
xreadgroup(String group, String consumer, Map<K,String> lastIdsPerStream)
Execute the command XREADGROUP.List<StreamMessage<K,F,V>>
xreadgroup(String group, String consumer, Map<K,String> lastIdsPerStream, XReadGroupArgs args)
Execute the command XREADGROUP.List<StreamMessage<K,F,V>>
xreadgroup(String group, String consumer, K key, String id)
Execute the command XREADGROUP.List<StreamMessage<K,F,V>>
xreadgroup(String group, String consumer, K key, String id, XReadGroupArgs args)
Execute the command XREADGROUP.List<StreamMessage<K,F,V>>
xrevrange(K key, StreamRange range)
Execute the command XRANGE.List<StreamMessage<K,F,V>>
xrevrange(K key, StreamRange range, int count)
Execute the command XREVRANGE.long
xtrim(K key, XTrimArgs args)
Execute the command XTRIM.long
xtrim(K key, String threshold)
Execute the command XTRIM.-
Methods inherited from class io.quarkus.redis.runtime.datasource.AbstractRedisCommandGroup
getDataSource
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.quarkus.redis.datasource.RedisCommands
getDataSource
-
-
-
-
Constructor Detail
-
BlockingStreamCommandsImpl
public BlockingStreamCommandsImpl(RedisDataSource ds, ReactiveStreamCommands<K,F,V> reactive, Duration timeout)
-
-
Method Detail
-
xack
public int xack(K key, String group, String... ids)
Description copied from interface:StreamCommands
Execute the command XACK. Summary: Marks a pending message as correctly processed, effectively removing it from the pending entries list of the consumer group. Return value of the command is the number of messages successfully acknowledged, that is, the IDs we were actually able to resolve in the PEL.The
XACK
command removes one or multiple messages from the Pending Entries List (PEL) of a stream consumer group. A message is pending, and as such stored inside the PEL, when it was delivered to some consumer, normally as a side effect of callingXREADGROUP
, or when a consumer took ownership of a message callingXCLAIM
. The pending message was delivered to some consumer but the server is yet not sure it was processed at least once. So new calls toXREADGROUP
to grab the messages history for a consumer (for instance using an ID of 0), will return such message. Similarly, the pending message will be listed by theXPENDING
command, that inspects the PEL.Once a consumer successfully processes a message, it should call
XACK
so that such message does not get processed again, and as a side effect, the PEL entry about this message is also purged, releasing memory from the Redis server.Group: stream Requires Redis 5.0.0+
- Specified by:
xack
in interfaceStreamCommands<K,F,V>
- Parameters:
key
- the keygroup
- the name of the consumer groupids
- the message ids to acknowledge- Returns:
- A
Uni
emitting the number of acknowledged messages. Certain message IDs may no longer be part of the PEL (for example because they have already been acknowledged), and XACK will not count them as successfully acknowledged.
-
xadd
public String xadd(K key, Map<F,V> payload)
Description copied from interface:StreamCommands
Execute the command XADD. Summary: Appends the specified stream entry to the stream at the specified key. If the key does not exist, as a side effect of running this command the key is created with a stream value. The creation of stream's key can be disabled with theNOMKSTREAM
option.An entry is composed of a list of field-value pairs. The field-value pairs are stored in the same order they are given by the user. Commands that read the stream, such as
XRANGE
orXREAD
, are guaranteed to return the fields and values exactly in the same order they were added byXADD
.XADD
is the only Redis command that can add data to a stream, but there are other commands, such asXDEL
andXTRIM
, that are able to remove data from a stream.Group: stream Requires Redis 5.0.0+
- Specified by:
xadd
in interfaceStreamCommands<K,F,V>
- Parameters:
key
- the keypayload
- the payload to write to the stream, must not benull
- Returns:
- A
Uni
emitting the id of the added message
-
xadd
public String xadd(K key, XAddArgs args, Map<F,V> payload)
Description copied from interface:StreamCommands
Execute the command XADD. Summary: Appends the specified stream entry to the stream at the specified key. If the key does not exist, as a side effect of running this command the key is created with a stream value. The creation of stream's key can be disabled with theNOMKSTREAM
option.An entry is composed of a list of field-value pairs. The field-value pairs are stored in the same order they are given by the user. Commands that read the stream, such as
XRANGE
orXREAD
, are guaranteed to return the fields and values exactly in the same order they were added byXADD
.XADD
is the only Redis command that can add data to a stream, but there are other commands, such asXDEL
andXTRIM
, that are able to remove data from a stream.Group: stream Requires Redis 5.0.0+
- Specified by:
xadd
in interfaceStreamCommands<K,F,V>
- Parameters:
key
- the keyargs
- the extra parameterspayload
- the payload to write to the stream, must not benull
- Returns:
- A
Uni
emitting the id of the added message
-
xautoclaim
public ClaimedMessages<K,F,V> xautoclaim(K key, String group, String consumer, Duration minIdleTime, String start, int count)
Description copied from interface:StreamCommands
Execute the command XAUTOCLAIM. Summary: Changes (or acquires) ownership of messages in a consumer group, as if the messages were delivered to the specified consumer.This command transfers ownership of pending stream entries that match the specified criteria. Conceptually,
XAUTOCLAIM
is equivalent to callingXPENDING
and thenXCLAIM
, but provides a more straightforward way to deal with message delivery failures viaSCAN
-like semantics.Like
XCLAIM
, the command operates on the stream entries atkey
and in the context of the providedgroup
. It transfers ownership to @{code consumer} of messages pending for more thanmin-idle-time
milliseconds and having an equal or greater ID thanstart
.Group: stream Requires Redis 6.2.0+
- Specified by:
xautoclaim
in interfaceStreamCommands<K,F,V>
- Parameters:
key
- key the keygroup
- string the consumer groupconsumer
- string the consumer idminIdleTime
- the min pending time of the message to claimstart
- the min id of the message to claimcount
- the upper limit of the number of entries to claim, default is 100.- Returns:
- A
Uni
emitting the claimed messages
-
xautoclaim
public ClaimedMessages<K,F,V> xautoclaim(K key, String group, String consumer, Duration minIdleTime, String start)
Description copied from interface:StreamCommands
Execute the command XAUTOCLAIM. Summary: Changes (or acquires) ownership of messages in a consumer group, as if the messages were delivered to the specified consumer.This command transfers ownership of pending stream entries that match the specified criteria. Conceptually,
XAUTOCLAIM
is equivalent to callingXPENDING
and thenXCLAIM
, but provides a more straightforward way to deal with message delivery failures viaSCAN
-like semantics.Like
XCLAIM
, the command operates on the stream entries atkey
and in the context of the providedgroup
. It transfers ownership to @{code consumer} of messages pending for more thanmin-idle-time
milliseconds and having an equal or greater ID thanstart
.Group: stream Requires Redis 6.2.0+
- Specified by:
xautoclaim
in interfaceStreamCommands<K,F,V>
- Parameters:
key
- key the keygroup
- string the consumer groupconsumer
- string the consumer idminIdleTime
- the min pending time of the message to claimstart
- the min id of the message to claim- Returns:
- A
Uni
emitting the claimed messages
-
xautoclaim
public ClaimedMessages<K,F,V> xautoclaim(K key, String group, String consumer, Duration minIdleTime, String start, int count, boolean justId)
Description copied from interface:StreamCommands
Execute the command XAUTOCLAIM. Summary: Changes (or acquires) ownership of messages in a consumer group, as if the messages were delivered to the specified consumer.This command transfers ownership of pending stream entries that match the specified criteria. Conceptually,
XAUTOCLAIM
is equivalent to callingXPENDING
and thenXCLAIM
, but provides a more straightforward way to deal with message delivery failures viaSCAN
-like semantics.Like
XCLAIM
, the command operates on the stream entries atkey
and in the context of the providedgroup
. It transfers ownership to @{code consumer} of messages pending for more thanmin-idle-time
milliseconds and having an equal or greater ID thanstart
.Group: stream Requires Redis 6.2.0+
- Specified by:
xautoclaim
in interfaceStreamCommands<K,F,V>
- Parameters:
key
- key the keygroup
- string the consumer groupconsumer
- string the consumer idminIdleTime
- the min pending time of the message to claimstart
- the min id of the message to claimcount
- the upper limit of the number of entries to claim, default is 100.justId
- iftrue
the returned structure would only contain the id of the messages and not the payloads- Returns:
- A
Uni
emitting the claimed messages
-
xclaim
public List<StreamMessage<K,F,V>> xclaim(K key, String group, String consumer, Duration minIdleTime, String... id)
Description copied from interface:StreamCommands
Execute the command XCLAIM. Summary: In the context of a stream consumer group, this command changes the ownership of a pending message, so that the new owner is the consumer specified as the command argument.Group: stream Requires Redis 5.0.0+
- Specified by:
xclaim
in interfaceStreamCommands<K,F,V>
- Parameters:
key
- key the keygroup
- string the consumer groupconsumer
- string the consumer idminIdleTime
- the min pending time of the message to claimid
- the message ids to claim, must not be empty, must not containnull
- Returns:
- A
Uni
emitting the claimed messages
-
xclaim
public List<StreamMessage<K,F,V>> xclaim(K key, String group, String consumer, Duration minIdleTime, XClaimArgs args, String... id)
Description copied from interface:StreamCommands
Execute the command XCLAIM. Summary: In the context of a stream consumer group, this command changes the ownership of a pending message, so that the new owner is the consumer specified as the command argument.Group: stream Requires Redis 5.0.0+
- Specified by:
xclaim
in interfaceStreamCommands<K,F,V>
- Parameters:
key
- key the keygroup
- string the consumer groupconsumer
- string the consumer idminIdleTime
- the min pending time of the message to claimargs
- the extra command parametersid
- the message ids to claim, must not be empty, must not containnull
- Returns:
- A
Uni
emitting the claimed messages
-
xdel
public int xdel(K key, String... id)
Description copied from interface:StreamCommands
Execute the command XDEL. Summary: Removes the specified entries from a stream, and returns the number of entries deleted. This number may be less than the number of IDs passed to the command in the case where some of the specified IDs do not exist in the stream.Group: stream Requires Redis 5.0.0+
- Specified by:
xdel
in interfaceStreamCommands<K,F,V>
- Parameters:
key
- key the keyid
- the message ids, must not be empty, must not containnull
- Returns:
- A
Uni
emitting the number of deleted messages
-
xgroupCreate
public void xgroupCreate(K key, String groupname, String from)
Description copied from interface:StreamCommands
Execute the command XGROUP CREATE. Summary: Create a new consumer group uniquely identified bygroupname
for the stream stored atkey
Group: stream Requires Redis 5.0.0+
- Specified by:
xgroupCreate
in interfaceStreamCommands<K,F,V>
- Parameters:
key
- key the keygroupname
- the name of the group, must be unique, and notnull
from
- the last delivered entry in the stream from the new group's perspective. The special ID$
is the ID of the last entry in the stream, but you can substitute it with any valid ID.
-
xgroupCreate
public void xgroupCreate(K key, String groupname, String from, XGroupCreateArgs args)
Description copied from interface:StreamCommands
Execute the command XGROUP CREATE. Summary: Create a new consumer group uniquely identified bygroupname
for the stream stored atkey
Group: stream Requires Redis 5.0.0+
- Specified by:
xgroupCreate
in interfaceStreamCommands<K,F,V>
- Parameters:
key
- key the keygroupname
- the name of the group, must be unique, and notnull
from
- the last delivered entry in the stream from the new group's perspective. The special ID$
is the ID of the last entry in the stream, but you can substitute it with any valid ID.args
- the extra command parameters
-
xgroupCreateConsumer
public boolean xgroupCreateConsumer(K key, String groupname, String consumername)
Description copied from interface:StreamCommands
Execute the command XGROUP CREATECONSUMER. Summary: Create a consumer namedconsumername
in the consumer groupgroupname
of the stream that's stored atkey
.Consumers are also created automatically whenever an operation, such as
XREADGROUP
, references a consumer that doesn't exist.Group: stream Requires Redis 6.2.0+
- Specified by:
xgroupCreateConsumer
in interfaceStreamCommands<K,F,V>
- Parameters:
key
- key the keygroupname
- the name of the group, must be unique, and notnull
consumername
- the consumer name- Returns:
- A
Uni
emittingtrue
if the consumer was created,false
otherwise.
-
xgroupDelConsumer
public long xgroupDelConsumer(K key, String groupname, String consumername)
Description copied from interface:StreamCommands
Execute the command XGROUP DELCONSUMER. Summary: Deletes a consumer from the consumer group.Group: stream Requires Redis 5.0.0+
- Specified by:
xgroupDelConsumer
in interfaceStreamCommands<K,F,V>
- Parameters:
key
- key the keygroupname
- the name of the group, must be unique, and notnull
consumername
- the consumer name- Returns:
- A
Uni
emitting the number of pending messages that the consumer had before it was deleted
-
xgroupDestroy
public boolean xgroupDestroy(K key, String groupname)
Description copied from interface:StreamCommands
Execute the command XGROUP DESTROY. Summary: Completely destroys a consumer group. The consumer group will be destroyed even if there are active consumers, and pending messages, so make sure to call this command only when really needed.Group: stream Requires Redis 5.0.0+
- Specified by:
xgroupDestroy
in interfaceStreamCommands<K,F,V>
- Parameters:
key
- key the keygroupname
- the name of the group, must be unique, and notnull
- Returns:
- A
Uni
emittingtrue
if the consumer group was destroyed,false
otherwise.
-
xgroupSetId
public void xgroupSetId(K key, String groupname, String from)
Description copied from interface:StreamCommands
Execute the command XGROUP SETID. Summary: Set the last delivered ID for a consumer group.Group: stream Requires Redis 5.0.0+
- Specified by:
xgroupSetId
in interfaceStreamCommands<K,F,V>
- Parameters:
key
- key the keygroupname
- the name of the group, must be unique, and notnull
from
- the last delivered entry in the stream from the new group's perspective. The special ID$
is the ID of the last entry in the stream, but you can substitute it with any valid ID.
-
xgroupSetId
public void xgroupSetId(K key, String groupname, String from, XGroupSetIdArgs args)
Description copied from interface:StreamCommands
Execute the command XGROUP SETID. Summary: Set the last delivered ID for a consumer group.Group: stream Requires Redis 5.0.0+
- Specified by:
xgroupSetId
in interfaceStreamCommands<K,F,V>
- Parameters:
key
- key the keygroupname
- the name of the group, must be unique, and notnull
from
- the last delivered entry in the stream from the new group's perspective. The special ID$
is the ID of the last entry in the stream, but you can substitute it with any valid ID.args
- the extra command parameters
-
xlen
public long xlen(K key)
Description copied from interface:StreamCommands
Execute the command XLEN. Summary: Returns the number of entries inside a stream.Group: stream Requires Redis 5.0.0+
- Specified by:
xlen
in interfaceStreamCommands<K,F,V>
- Parameters:
key
- key the key- Returns:
- A
Uni
emitting the number of messages in the stream
-
xrange
public List<StreamMessage<K,F,V>> xrange(K key, StreamRange range, int count)
Description copied from interface:StreamCommands
Execute the command XRANGE. Summary: The command returns the stream entries matching a given range of IDs.Group: stream Requires Redis 5.0.0+
- Specified by:
xrange
in interfaceStreamCommands<K,F,V>
- Parameters:
key
- key the keyrange
- the range, must not benull
count
- the max number of entries to return- Returns:
- A
Uni
emitting a list containing the messages from the given range.
-
xrange
public List<StreamMessage<K,F,V>> xrange(K key, StreamRange range)
Description copied from interface:StreamCommands
Execute the command XRANGE. Summary: The command returns the stream entries matching a given range of IDs.Group: stream Requires Redis 5.0.0+
- Specified by:
xrange
in interfaceStreamCommands<K,F,V>
- Parameters:
key
- key the keyrange
- the range, must not benull
- Returns:
- A
Uni
emitting a list containing the messages from the given range.
-
xread
public List<StreamMessage<K,F,V>> xread(K key, String id)
Description copied from interface:StreamCommands
Execute the command XREAD. Summary: Read data from one or multiple streams, only returning entries with an ID greater than the last received ID reported by the caller. This command has an option to block if items are not available, in a similar fashion toBRPOP
orBZPOPMIN
and others.Group: stream Requires Redis 5.0.0+
- Specified by:
xread
in interfaceStreamCommands<K,F,V>
- Parameters:
key
- key the key of the streamid
- the last read id- Returns:
- A
Uni
emitting a list containing the messages.
-
xread
public List<StreamMessage<K,F,V>> xread(Map<K,String> lastIdsPerStream)
Description copied from interface:StreamCommands
Execute the command XREAD. Summary: Read data from one or multiple streams, only returning entries with an ID greater than the last received ID reported by the caller. This command has an option to block if items are not available, in a similar fashion toBRPOP
orBZPOPMIN
and others.Group: stream Requires Redis 5.0.0+
- Specified by:
xread
in interfaceStreamCommands<K,F,V>
- Parameters:
lastIdsPerStream
- the map of key -> id indicating the last received id per stream to read- Returns:
- A
Uni
emitting a list containing the messages.
-
xread
public List<StreamMessage<K,F,V>> xread(K key, String id, XReadArgs args)
Description copied from interface:StreamCommands
Execute the command XREAD. Summary: Read data from one or multiple streams, only returning entries with an ID greater than the last received ID reported by the caller. This command has an option to block if items are not available, in a similar fashion toBRPOP
orBZPOPMIN
and others.Group: stream Requires Redis 5.0.0+
- Specified by:
xread
in interfaceStreamCommands<K,F,V>
- Parameters:
key
- key the key of the streamid
- the last read idargs
- the extra parameter- Returns:
- A
Uni
emitting a list containing the messages.
-
xread
public List<StreamMessage<K,F,V>> xread(Map<K,String> lastIdsPerStream, XReadArgs args)
Description copied from interface:StreamCommands
Execute the command XREAD. Summary: Read data from one or multiple streams, only returning entries with an ID greater than the last received ID reported by the caller. This command has an option to block if items are not available, in a similar fashion toBRPOP
orBZPOPMIN
and others.Group: stream Requires Redis 5.0.0+
- Specified by:
xread
in interfaceStreamCommands<K,F,V>
- Parameters:
lastIdsPerStream
- the map of key -> id indicating the last received id per stream to readargs
- the extra parameter- Returns:
- A
Uni
emitting a list containing the messages.
-
xreadgroup
public List<StreamMessage<K,F,V>> xreadgroup(String group, String consumer, K key, String id)
Description copied from interface:StreamCommands
Execute the command XREADGROUP. Summary: TheXREADGROUP
command is a special version of theXREAD
command with support for consumer groups.Group: stream Requires Redis 5.0.0+
- Specified by:
xreadgroup
in interfaceStreamCommands<K,F,V>
- Parameters:
group
- the group nameconsumer
- the consumer namekey
- the stream keyid
- the last read id- Returns:
- A
Uni
emitting a list containing the messages.
-
xreadgroup
public List<StreamMessage<K,F,V>> xreadgroup(String group, String consumer, Map<K,String> lastIdsPerStream)
Description copied from interface:StreamCommands
Execute the command XREADGROUP. Summary: TheXREADGROUP
command is a special version of theXREAD
command with support for consumer groups.Group: stream Requires Redis 5.0.0+
- Specified by:
xreadgroup
in interfaceStreamCommands<K,F,V>
- Parameters:
group
- the group nameconsumer
- the consumer namelastIdsPerStream
- the map of key -> id indicating the last received id per stream to read- Returns:
- A
Uni
emitting a list containing the messages.
-
xreadgroup
public List<StreamMessage<K,F,V>> xreadgroup(String group, String consumer, K key, String id, XReadGroupArgs args)
Description copied from interface:StreamCommands
Execute the command XREADGROUP. Summary: TheXREADGROUP
command is a special version of theXREAD
command with support for consumer groups.Group: stream Requires Redis 5.0.0+
- Specified by:
xreadgroup
in interfaceStreamCommands<K,F,V>
- Parameters:
group
- the group nameconsumer
- the consumer namekey
- the stream keyid
- the last read idargs
- the extra parameter- Returns:
- A
Uni
emitting a list containing the messages.
-
xreadgroup
public List<StreamMessage<K,F,V>> xreadgroup(String group, String consumer, Map<K,String> lastIdsPerStream, XReadGroupArgs args)
Description copied from interface:StreamCommands
Execute the command XREADGROUP. Summary: TheXREADGROUP
command is a special version of theXREAD
command with support for consumer groups.Group: stream Requires Redis 5.0.0+
- Specified by:
xreadgroup
in interfaceStreamCommands<K,F,V>
- Parameters:
group
- the group nameconsumer
- the consumer namelastIdsPerStream
- the map of key -> id indicating the last received id per stream to readargs
- the extra parameter- Returns:
- A
Uni
emitting a list containing the messages.
-
xrevrange
public List<StreamMessage<K,F,V>> xrevrange(K key, StreamRange range, int count)
Description copied from interface:StreamCommands
Execute the command XREVRANGE. Summary: This command is exactly likeXRANGE
, but with the notable difference of returning the entries in reverse order, and also taking the start-end range in reverse order: inXREVRANGE
you need to state the end ID and later the start ID, and the command will produce all the element between (or exactly like) the two IDs, starting from the end side.Group: stream Requires Redis 5.0.0+
- Specified by:
xrevrange
in interfaceStreamCommands<K,F,V>
- Parameters:
key
- key the keyrange
- the range, must not benull
count
- the max number of entries to return- Returns:
- A
Uni
emitting a list containing the messages from the given range.
-
xrevrange
public List<StreamMessage<K,F,V>> xrevrange(K key, StreamRange range)
Description copied from interface:StreamCommands
Execute the command XRANGE. Summary: This command is exactly likeXRANGE
, but with the notable difference of returning the entries in reverse order, and also taking the start-end range in reverse order: inXREVRANGE
you need to state the end ID and later the start ID, and the command will produce all the element between (or exactly like) the two IDs, starting from the end side.Group: stream Requires Redis 5.0.0+
- Specified by:
xrevrange
in interfaceStreamCommands<K,F,V>
- Parameters:
key
- key the keyrange
- the range, must not benull
- Returns:
- A
Uni
emitting a list containing the messages from the given range.
-
xtrim
public long xtrim(K key, String threshold)
Description copied from interface:StreamCommands
Execute the command XTRIM. Summary: Trims the stream by evicting older entries (entries with lower IDs) if needed.Group: stream Requires Redis 5.0.0+
- Specified by:
xtrim
in interfaceStreamCommands<K,F,V>
- Parameters:
key
- the keythreshold
- the threshold- Returns:
- A
Uni
emitting the number of entries deleted from the stream
-
xtrim
public long xtrim(K key, XTrimArgs args)
Description copied from interface:StreamCommands
Execute the command XTRIM. Summary: Trims the stream by evicting older entries (entries with lower IDs) if needed.Group: stream Requires Redis 5.0.0+
- Specified by:
xtrim
in interfaceStreamCommands<K,F,V>
- Parameters:
key
- the keyargs
- the extra parameters- Returns:
- A
Uni
emitting the number of entries deleted from the stream
-
xpending
public XPendingSummary xpending(K key, String group)
Description copied from interface:StreamCommands
Execute the command XPENDING. Summary: The XPENDING command is the interface to inspect the list of pending messages, and is as thus a very important command in order to observe and understand what is happening with a streams consumer groups: what clients are active, what messages are pending to be consumed, or to see if there are idle messages.Group: stream Requires Redis 5.0.0+
This variant of xpending uses the summary form.
- Specified by:
xpending
in interfaceStreamCommands<K,F,V>
- Parameters:
key
- the keygroup
- the group- Returns:
- the xpending summary
-
xpending
public List<PendingMessage> xpending(K key, String group, StreamRange range, int count)
Description copied from interface:StreamCommands
Execute the command XPENDING. Summary: The XPENDING command is the interface to inspect the list of pending messages, and is as thus a very important command in order to observe and understand what is happening with a streams consumer groups: what clients are active, what messages are pending to be consumed, or to see if there are idle messages.Group: stream Requires Redis 5.0.0+
This variant of xpending uses the extended form.
- Specified by:
xpending
in interfaceStreamCommands<K,F,V>
- Parameters:
key
- the keygroup
- the grouprange
- the rangecount
- the number of message to include- Returns:
- the list of pending messages
-
xpending
public List<PendingMessage> xpending(K key, String group, StreamRange range, int count, XPendingArgs args)
Description copied from interface:StreamCommands
Execute the command XPENDING. Summary: The XPENDING command is the interface to inspect the list of pending messages, and is as thus a very important command in order to observe and understand what is happening with a streams consumer groups: what clients are active, what messages are pending to be consumed, or to see if there are idle messages.Group: stream Requires Redis 5.0.0+
This variant of xpending uses the extended form. If the extra parameter include the name of the consumer, the produced list will only contain 0 or 1 item.
- Specified by:
xpending
in interfaceStreamCommands<K,F,V>
- Parameters:
key
- the keygroup
- the grouprange
- the rangecount
- the number of message to includeargs
- the extra argument (idle and consumer)- Returns:
- the list of pending messages
-
-