Class MessageParams<V>

java.lang.Object
org.redisson.api.MessageParams<V>
Type Parameters:
V - type
All Implemented Interfaces:
MessageArgs<V>

public final class MessageParams<V> extends Object implements MessageArgs<V>
Author:
Nikita Koksharov
  • Constructor Details

    • MessageParams

      public MessageParams(V value)
  • Method Details

    • priority

      public MessageArgs<V> priority(int priority)
      Description copied from interface: MessageArgs
      Sets the priority level for the message. Defined as a number between 0 and 9

      0 is the lowest priority level.

      9 is the highest priority level.

      Default value is 0.

      Specified by:
      priority in interface MessageArgs<V>
      Parameters:
      priority - the priority level
      Returns:
      arguments object
    • delay

      public MessageArgs<V> delay(Duration interval)
      Description copied from interface: MessageArgs
      Sets a delay interval before the message becomes available for processing.

      0 value means delay duration is not applied. If not defined, the queue's delay setting value is used. If queue's delay setting is also not set, the default value is 0.

      Specified by:
      delay in interface MessageArgs<V>
      Parameters:
      interval - the time duration to delay message delivery
      Returns:
      arguments object
    • timeToLive

      public MessageArgs<V> timeToLive(Duration duration)
      Description copied from interface: MessageArgs
      Sets the time-to-live duration for the message.

      After this duration has elapsed, the message is removed from the queue if it hasn't been processed.

      0 value means expiration is not applied. If not defined, the queue's timeToLive setting value is used. If queue's timeToLive setting is also not set, the default value is 0.

      Specified by:
      timeToLive in interface MessageArgs<V>
      Parameters:
      duration - the time duration
      Returns:
      arguments object
    • deliveryLimit

      public MessageArgs<V> deliveryLimit(int value)
      Description copied from interface: MessageArgs
      Sets the maximum number of delivery attempts for the message.

      If processing the message fails, it may be redelivered up to the specified count.

      The minimum value is 1. If not defined, the queue's deliveryLimit setting value is used. If queue's deliveryLimit setting is also not set, the default value is 10.
      Specified by:
      deliveryLimit in interface MessageArgs<V>
      Parameters:
      value - the maximum number of delivery attempts
      Returns:
      arguments object
    • header

      public MessageArgs<V> header(String key, Object value)
      Description copied from interface: MessageArgs
      Adds a single header entry to the message.
      Specified by:
      header in interface MessageArgs<V>
      Parameters:
      key - the header key
      value - the header value
      Returns:
      arguments object
    • headers

      public MessageArgs<V> headers(Map<String,Object> entries)
      Description copied from interface: MessageArgs
      Adds multiple header entries to the message at once.
      Specified by:
      headers in interface MessageArgs<V>
      Parameters:
      entries - a map containing header key-value pairs
      Returns:
      arguments object
    • deduplicationByHash

      public MessageArgs<V> deduplicationByHash(Duration interval)
      Description copied from interface: MessageArgs
      Enables deduplication based on the payload hash for the specified interval.

      During the specified interval, messages with the same hash will be considered duplicates and won't be added to the queue.

      Specified by:
      deduplicationByHash in interface MessageArgs<V>
      Parameters:
      interval - the time duration
      Returns:
      arguments object
    • deduplicationById

      public MessageArgs<V> deduplicationById(Object id, Duration interval)
      Description copied from interface: MessageArgs
      Enables deduplication based on a custom ID for the specified interval.

      During the specified interval, messages with the same ID will be considered duplicates and won't be added to the queue.

      Specified by:
      deduplicationById in interface MessageArgs<V>
      Parameters:
      id - the custom identifier
      interval - the time duration
      Returns:
      arguments object
    • deduplicationByHash

      public MessageArgs<V> deduplicationByHash()
    • deduplicationById

      public MessageArgs<V> deduplicationById(Object id)
    • getRetentionDuration

      public long getRetentionDuration()
    • getReceiveLimit

      public int getReceiveLimit()
    • getHeaders

      public Map<String,Object> getHeaders()
    • getPayload

      public V getPayload()
    • getDeduplicationMode

      public DeduplicationMode getDeduplicationMode()
    • getDeduplicationInterval

      public Duration getDeduplicationInterval()
    • getDeduplicationId

      public Object getDeduplicationId()
    • getDelayInterval

      public Duration getDelayInterval()
    • getPriority

      public int getPriority()