Package io.lettuce.core
Class XClaimArgs
- java.lang.Object
-
- io.lettuce.core.XClaimArgs
-
- All Implemented Interfaces:
CompositeArgument
public class XClaimArgs extends Object implements CompositeArgument
Argument list builder for the Redis XCLAIM command. Static import the methods fromXClaimArgs.Builder
and call the methods:minIdleTime(…)
.XClaimArgs
is a mutable object and instances should be used only once to avoid shared mutable state.- Since:
- 5.1
- Author:
- Mark Paluch
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
XClaimArgs.Builder
Builder entry points forXAddArgs
.
-
Constructor Summary
Constructors Constructor Description XClaimArgs()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <K,V>
voidbuild(CommandArgs<K,V> args)
Build command arguments and contribute arguments toCommandArgs
.XClaimArgs
force()
Creates the pending message entry in the PEL even if certain specified IDs are not already in the PEL assigned to a different client.XClaimArgs
force(boolean force)
Creates the pending message entry in the PEL even if certain specified IDs are not already in the PEL assigned to a different client.XClaimArgs
idle(long milliseconds)
Set the idle time (last time it was delivered) of the message.XClaimArgs
idle(Duration idleTime)
Set the idle time (last time it was delivered) of the message.XClaimArgs
justid()
Set theJUSTID
flag to return just the message id and do not increment the retry counter.XClaimArgs
minIdleTime(long milliseconds)
Return only messages that are idle for at leastmilliseconds
.XClaimArgs
minIdleTime(Duration minIdleTime)
Return only messages that are idle for at leastminIdleTime
.XClaimArgs
retryCount(long retrycount)
Set the retry counter to the specified value.XClaimArgs
time(long millisecondsUnixTime)
This is the same as IDLE but instead of a relative amount of milliseconds, it sets the idle time to a specific unix time (in milliseconds).XClaimArgs
time(TemporalAccessor timestamp)
This is the same as IDLE but instead of a relative amount of milliseconds, it sets the idle time to a specific unix time (in milliseconds).
-
-
-
Method Detail
-
justid
public XClaimArgs justid()
Set theJUSTID
flag to return just the message id and do not increment the retry counter. The message body is not returned when callingXCLAIM
.- Returns:
this
.- Since:
- 5.3
-
minIdleTime
public XClaimArgs minIdleTime(long milliseconds)
Return only messages that are idle for at leastmilliseconds
.- Parameters:
milliseconds
- min idle time.- Returns:
this
.
-
minIdleTime
public XClaimArgs minIdleTime(Duration minIdleTime)
Return only messages that are idle for at leastminIdleTime
.- Parameters:
minIdleTime
- min idle time.- Returns:
this
.
-
idle
public XClaimArgs idle(long milliseconds)
Set the idle time (last time it was delivered) of the message. If IDLE is not specified, an IDLE of 0 is assumed, that is, the time count is reset because the message has now a new owner trying to process it- Parameters:
milliseconds
- idle time.- Returns:
this
.
-
idle
public XClaimArgs idle(Duration idleTime)
Set the idle time (last time it was delivered) of the message. If IDLE is not specified, an IDLE of 0 is assumed, that is, the time count is reset because the message has now a new owner trying to process it- Parameters:
idleTime
- idle time.- Returns:
this
.
-
time
public XClaimArgs time(long millisecondsUnixTime)
This is the same as IDLE but instead of a relative amount of milliseconds, it sets the idle time to a specific unix time (in milliseconds). This is useful in order to rewrite the AOF file generating XCLAIM commands.- Parameters:
millisecondsUnixTime
- idle time.- Returns:
this
.
-
time
public XClaimArgs time(TemporalAccessor timestamp)
This is the same as IDLE but instead of a relative amount of milliseconds, it sets the idle time to a specific unix time (in milliseconds). This is useful in order to rewrite the AOF file generating XCLAIM commands.- Parameters:
timestamp
- idle time.- Returns:
this
.
-
retryCount
public XClaimArgs retryCount(long retrycount)
Set the retry counter to the specified value. This counter is incremented every time a message is delivered again. NormallyXCLAIM
does not alter this counter, which is just served to clients when the XPENDING command is called: this way clients can detect anomalies, like messages that are never processed for some reason after a big number of delivery attempts.- Parameters:
retrycount
- number of retries.- Returns:
this
.
-
force
public XClaimArgs force()
Creates the pending message entry in the PEL even if certain specified IDs are not already in the PEL assigned to a different client. However the message must be exist in the stream, otherwise the IDs of non existing messages are ignored.- Returns:
this
.
-
force
public XClaimArgs force(boolean force)
Creates the pending message entry in the PEL even if certain specified IDs are not already in the PEL assigned to a different client. However the message must be exist in the stream, otherwise the IDs of non existing messages are ignored.- Parameters:
force
-true
to enforce PEL creation.- Returns:
this
.
-
build
public <K,V> void build(CommandArgs<K,V> args)
Description copied from interface:CompositeArgument
Build command arguments and contribute arguments toCommandArgs
.Implementing classes are required to implement this method. Depending on the command nature and configured arguments, this method may contribute arguments but is not required to add arguments if none are specified.
- Specified by:
build
in interfaceCompositeArgument
- Type Parameters:
K
- Key type.V
- Value type.- Parameters:
args
- the command arguments, must not benull
.
-
-