Class QueuePollParams

java.lang.Object
org.redisson.api.BaseSyncParams<QueuePollArgs>
org.redisson.api.queue.QueuePollParams
All Implemented Interfaces:
QueuePollArgs, SyncArgs<QueuePollArgs>

public final class QueuePollParams extends BaseSyncParams<QueuePollArgs> implements QueuePollArgs
  • Constructor Details

    • QueuePollParams

      public QueuePollParams()
  • Method Details

    • acknowledgeMode

      public QueuePollArgs acknowledgeMode(AcknowledgeMode mode)
      Description copied from interface: QueuePollArgs
      Sets the acknowledgment mode for message processing.

      The acknowledgment mode determines how messages are acknowledged after retrieval:

      • AcknowledgeMode.AUTO - Messages are automatically acknowledged after delivery
      • AcknowledgeMode.MANUAL - Messages must be explicitly acknowledged by the consumer

      Default value is AcknowledgeMode.MANUAL
      Specified by:
      acknowledgeMode in interface QueuePollArgs
      Parameters:
      mode - the acknowledgment mode to use
      Returns:
      arguments object
      See Also:
    • headersCodec

      public QueuePollArgs headersCodec(Codec codec)
      Description copied from interface: QueuePollArgs
      Specifies the codec to use for decoding message headers.
      Specified by:
      headersCodec in interface QueuePollArgs
      Parameters:
      codec - the codec to use for header deserialization
      Returns:
      arguments object
    • timeout

      public QueuePollArgs timeout(Duration timeout)
      Description copied from interface: QueuePollArgs
      Sets the maximum time to wait for messages to become available.

      If the queue is empty, the poll operation will block until either:

      • At least one message becomes available
      • The specified timeout duration elapses

      If the timeout elapses without any messages becoming available, the poll operation will return empty collection of messages.

      0 means to wait indefinitely for a message.

      Default value is undefined.

      Specified by:
      timeout in interface QueuePollArgs
      Parameters:
      timeout - the maximum duration to wait for messages
      Returns:
      arguments object
    • visibility

      public QueuePollArgs visibility(Duration visibility)
      Description copied from interface: QueuePollArgs
      Sets the visibility timeout for retrieved messages.

      The visibility timeout specifies how long a message will be hidden from other consumers after it has been retrieved but before it has been acknowledged or negatively acknowledged. This prevents other consumers from processing the same message while it's being handled.

      If a message is not acknowledged within this time period, it will become visible again in the queue and may be delivered to another consumer.

      If not defined, the queue's visibility setting value is used. If queue's visibility setting is also not set, the default value is 30 seconds.

      Specified by:
      visibility in interface QueuePollArgs
      Parameters:
      visibility - the duration for which retrieved messages should remain invisible to other consumers
      Returns:
      arguments object
    • count

      public QueuePollArgs count(int value)
      Description copied from interface: QueuePollArgs
      Sets the maximum number of messages to retrieve in a single poll operation.

      This parameter enables batch retrieval of messages, which can improve throughput when processing multiple messages at once. The actual number of messages returned may be less than the requested count if fewer messages are available.

      Specified by:
      count in interface QueuePollArgs
      Parameters:
      value - the maximum number of messages to retrieve
      Returns:
      arguments object
    • getTimeout

      public Duration getTimeout()
    • getVisibility

      public Duration getVisibility()
    • getCount

      public int getCount()
    • getHeadersCodec

      public Codec getHeadersCodec()
    • getAcknowledgeMode

      public AcknowledgeMode getAcknowledgeMode()