Module lettuce.core

Class XClaimArgs

java.lang.Object
io.lettuce.core.XClaimArgs

public class XClaimArgs
extends Object
Argument list builder for the Redis XCLAIM command. Static import the methods from XClaimArgs.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 for XAddArgs.
  • Constructor Summary

    Constructors
    Constructor Description
    XClaimArgs()  
  • Method Summary

    Modifier and Type Method Description
    <K,​ V> void build​(CommandArgs<K,​V> args)  
    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 the JUSTID 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 least milliseconds.
    XClaimArgs minIdleTime​(Duration minIdleTime)
    Return only messages that are idle for at least minIdleTime.
    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).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • XClaimArgs

      public XClaimArgs()
  • Method Details

    • justid

      public XClaimArgs justid()
      Set the JUSTID flag to return just the message id and do not increment the retry counter. The message body is not returned when calling XCLAIM.
      Returns:
      this.
      Since:
      5.3
    • minIdleTime

      public XClaimArgs minIdleTime​(long milliseconds)
      Return only messages that are idle for at least milliseconds.
      Parameters:
      milliseconds - min idle time.
      Returns:
      this.
    • minIdleTime

      public XClaimArgs minIdleTime​(Duration minIdleTime)
      Return only messages that are idle for at least minIdleTime.
      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. Normally XCLAIM 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)