Interface MessageArgs<V>
- Type Parameters:
V- type
- All Known Implementing Classes:
MessageParams
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptiondeduplicationByHash(Duration interval) Enables deduplication based on the payload hash for the specified interval.deduplicationById(Object id, Duration interval) Enables deduplication based on a custom ID for the specified interval.Sets a delay interval before the message becomes available for processing.deliveryLimit(int count) Sets the maximum number of delivery attempts for the message.Adds a single header entry to the message.Adds multiple header entries to the message at once.static <V> MessageArgs<V> payload(V value) Defines the payload to include in the messagepriority(int priority) Sets the priority level for the message.timeToLive(Duration value) Sets the time-to-live duration for the message.
-
Method Details
-
priority
Sets the priority level for the message. Defined as a number between0and90is the lowest priority level.9is the highest priority level.Default value is
0.- Parameters:
priority- the priority level- Returns:
- arguments object
-
delay
Sets a delay interval before the message becomes available for processing.0value 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 is0.- Parameters:
interval- the time duration to delay message delivery- Returns:
- arguments object
-
deduplicationByHash
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.
- Parameters:
interval- the time duration- Returns:
- arguments object
-
deduplicationById
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.
- Parameters:
id- the custom identifierinterval- the time duration- Returns:
- arguments object
-
timeToLive
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.
0value 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 is0.- Parameters:
value- the time duration- Returns:
- arguments object
-
deliveryLimit
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 is1. If not defined, the queue's deliveryLimit setting value is used. If queue's deliveryLimit setting is also not set, the default value is10.- Parameters:
count- the maximum number of delivery attempts- Returns:
- arguments object
-
header
Adds a single header entry to the message.- Parameters:
key- the header keyvalue- the header value- Returns:
- arguments object
-
headers
Adds multiple header entries to the message at once.- Parameters:
entries- a map containing header key-value pairs- Returns:
- arguments object
-
payload
Defines the payload to include in the message- Parameters:
value- the payload to include- Returns:
- arguments object
-