Class QueueConfigParams

java.lang.Object
org.redisson.api.queue.QueueConfigParams
All Implemented Interfaces:
QueueConfig

public final class QueueConfigParams extends Object implements QueueConfig
  • Constructor Details

    • QueueConfigParams

      public QueueConfigParams()
  • Method Details

    • deliveryLimit

      public QueueConfig deliveryLimit(int value)
      Description copied from interface: QueueConfig
      Defines the maximum number of delivery attempts for a message. Once this limit is reached, the message may be moved to a dead letter queue if it's configured, otherwise it will be deleted. Can be overridden when adding a message.

      Default value is 10 attempts.

      Specified by:
      deliveryLimit in interface QueueConfig
      Parameters:
      value - the maximum number of delivery attempts
      Returns:
      config object
    • visibility

      public QueueConfig visibility(Duration value)
      Description copied from interface: QueueConfig
      Sets the duration for which a message becomes invisible to other consumers after being polled. This prevents multiple consumers from processing the same message simultaneously. Can be overridden when pooling a message.

      Default value is 30 seconds.

      Specified by:
      visibility in interface QueueConfig
      Parameters:
      value - the visibility timeout duration
      Returns:
      config object
    • timeToLive

      public QueueConfig timeToLive(Duration value)
      Description copied from interface: QueueConfig
      Sets the time-to-live duration for messages in the queue. Messages will be automatically removed from the queue after this duration expires. 0 value means expiration is not applied. Can be overridden when adding a message.

      Default value is 0.

      Specified by:
      timeToLive in interface QueueConfig
      Parameters:
      value - the time-to-live duration
      Returns:
      config object
    • deadLetterQueueName

      public QueueConfig deadLetterQueueName(String value)
      Description copied from interface: QueueConfig
      Sets the name of the Dead Letter Queue (DLQ) to which messages that have reached the delivery limit or have been rejected are sent.

      Dead letter queue can be removed by setting null value.

      Specified by:
      deadLetterQueueName in interface QueueConfig
      Parameters:
      value - the name of the dead letter queue
      Returns:
      config object
    • maxMessageSize

      public QueueConfig maxMessageSize(int value)
      Description copied from interface: QueueConfig
      Sets the maximum allowed size (in bytes) for a single message in the queue. Messages exceeding this size will be rejected. 0 value means size limit is not applied.

      Default value is 0.

      Specified by:
      maxMessageSize in interface QueueConfig
      Parameters:
      value - the maximum message size in bytes
      Returns:
      config object
    • delay

      public QueueConfig delay(Duration value)
      Description copied from interface: QueueConfig
      Sets the delay duration before a message becomes available for consumption after being added to the queue. 0 value means delay duration is not applied. Can be overridden when adding a message.

      Default value is 0.

      Specified by:
      delay in interface QueueConfig
      Parameters:
      value - the delay duration
      Returns:
      config object
    • maxSize

      public QueueConfig maxSize(int value)
      Description copied from interface: QueueConfig
      Sets the maximum number of messages that can be stored in the queue. When the queue reaches this size, add messages operation may be blocked and/or return empty result. 0 value means queue size limit is not applied.

      Default value is 0.

      Specified by:
      maxSize in interface QueueConfig
      Parameters:
      value - the maximum queue size
      Returns:
      config object
    • processingMode

      public QueueConfig processingMode(ProcessingMode mode)
      Description copied from interface: QueueConfig
      Sets the processing mode for the queue which determines how messages are processed by consumers.
      Specified by:
      processingMode in interface QueueConfig
      Parameters:
      mode - the processing mode
      Returns:
      config object
    • getDeliveryLimit

      public int getDeliveryLimit()
    • getVisibilityTimeout

      public Duration getVisibilityTimeout()
    • getTtl

      public Duration getTtl()
    • getDeadLetterQueueName

      public String getDeadLetterQueueName()
    • getMaxMessageSize

      public int getMaxMessageSize()
    • getDelay

      public Duration getDelay()
    • getMaxSize

      public int getMaxSize()
    • getProcessingMode

      public ProcessingMode getProcessingMode()