Class QueuePollParams
- All Implemented Interfaces:
QueuePollArgs,SyncArgs<QueuePollArgs>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets the acknowledgment mode for message processing.count(int value) Sets the maximum number of messages to retrieve in a single poll operation.intgetCount()headersCodec(Codec codec) Specifies the codec to use for decoding message headers.Sets the maximum time to wait for messages to become available.visibility(Duration visibility) Sets the visibility timeout for retrieved messages.Methods inherited from class org.redisson.api.BaseSyncParams
getSyncFailureMode, getSyncMode, getSyncTimeout, syncFailureMode, syncMode, syncTimeoutMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.redisson.api.SyncArgs
syncFailureMode, syncMode, syncTimeout
-
Constructor Details
-
QueuePollParams
public QueuePollParams()
-
-
Method Details
-
acknowledgeMode
Description copied from interface:QueuePollArgsSets the acknowledgment mode for message processing.The acknowledgment mode determines how messages are acknowledged after retrieval:
AcknowledgeMode.AUTO- Messages are automatically acknowledged after deliveryAcknowledgeMode.MANUAL- Messages must be explicitly acknowledged by the consumer
- Specified by:
acknowledgeModein interfaceQueuePollArgs- Parameters:
mode- the acknowledgment mode to use- Returns:
- arguments object
- See Also:
-
headersCodec
Description copied from interface:QueuePollArgsSpecifies the codec to use for decoding message headers.- Specified by:
headersCodecin interfaceQueuePollArgs- Parameters:
codec- the codec to use for header deserialization- Returns:
- arguments object
-
timeout
Description copied from interface:QueuePollArgsSets 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.
0means to wait indefinitely for a message.Default value is undefined.
- Specified by:
timeoutin interfaceQueuePollArgs- Parameters:
timeout- the maximum duration to wait for messages- Returns:
- arguments object
-
visibility
Description copied from interface:QueuePollArgsSets 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:
visibilityin interfaceQueuePollArgs- Parameters:
visibility- the duration for which retrieved messages should remain invisible to other consumers- Returns:
- arguments object
-
count
Description copied from interface:QueuePollArgsSets 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:
countin interfaceQueuePollArgs- Parameters:
value- the maximum number of messages to retrieve- Returns:
- arguments object
-
getTimeout
-
getVisibility
-
getCount
public int getCount() -
getHeadersCodec
-
getAcknowledgeMode
-