JavaScript is disabled on your browser.
Skip navigation links

AWS SDK for Java 1.x API Reference - 1.12.795

We announced the upcoming end-of-support for AWS SDK for Java (v1). We recommend that you migrate to AWS SDK for Java v2. For dates, additional details, and information on how to migrate, please refer to the linked announcement.
com.amazonaws.services.sqs.buffered

Class QueueBufferConfig



  • public class QueueBufferConfig
    extends Object 
    • Field Detail

      • SERVICE_MAX_BATCH_SIZE_BYTES

        public static final long SERVICE_MAX_BATCH_SIZE_BYTES
        Updated as the service now supports messages of size max 256 KiB.
        See Also:
        Constant Field Values
      • MAX_BATCH_OPEN_MS_DEFAULT

        public static final long MAX_BATCH_OPEN_MS_DEFAULT
        200 milliseconds
        See Also:
        Constant Field Values
      • MAX_INFLIGHT_OUTBOUND_BATCHES_DEFAULT

        public static final int MAX_INFLIGHT_OUTBOUND_BATCHES_DEFAULT
        5 batches
        See Also:
        Constant Field Values
      • MAX_INFLIGHT_RECEIVE_BATCHES_DEFAULT

        public static final int MAX_INFLIGHT_RECEIVE_BATCHES_DEFAULT
        10 batches
        See Also:
        Constant Field Values
      • MAX_DONE_RECEIVE_BATCHES_DEFAULT

        public static final int MAX_DONE_RECEIVE_BATCHES_DEFAULT
        10 batches
        See Also:
        Constant Field Values
      • MAX_BATCH_SIZE_BYTES_DEFAULT

        public static final long MAX_BATCH_SIZE_BYTES_DEFAULT
        256 kilobytes
        See Also:
        Constant Field Values
      • VISIBILITY_TIMEOUT_SECONDS_DEFAULT

        public static final int VISIBILITY_TIMEOUT_SECONDS_DEFAULT
        -1, which means use the visibility timeout of the queue
        See Also:
        Constant Field Values
      • LONGPOLL_WAIT_TIMEOUT_SECONDS_DEFAULT

        public static final int LONGPOLL_WAIT_TIMEOUT_SECONDS_DEFAULT
        See Also:
        Constant Field Values
      • MIN_RECEIVE_WAIT_TIME_MS_DEFAULT

        public static final int MIN_RECEIVE_WAIT_TIME_MS_DEFAULT
        50 ms, which is in the ballpark for typical latency contacting a remote service like SQS
        See Also:
        Constant Field Values
      • RECEIVE_MESSAGE_ATTRIBUTE_NAMES_DEFAULT

        public static final List<String> RECEIVE_MESSAGE_ATTRIBUTE_NAMES_DEFAULT
      • RECEIVE_ATTRIBUTE_NAMES_DEFAULT

        public static final List<String> RECEIVE_ATTRIBUTE_NAMES_DEFAULT
      • ADAPTIVE_PREFETCHING_DEFAULT

        public static final boolean ADAPTIVE_PREFETCHING_DEFAULT
        See Also:
        Constant Field Values
    • Constructor Detail

      • QueueBufferConfig

        public QueueBufferConfig(long maxBatchOpenMs,
         int maxInflightOutboundBatches,
         int maxInflightReceiveBatches,
         int maxDoneReceiveBatches,
         boolean paramLongPoll,
         long maxBatchSizeBytes,
         int visibilityTimeout,
         int longPollTimeout,
         int maxBatch)
      • QueueBufferConfig

        public QueueBufferConfig()
      • QueueBufferConfig

        public QueueBufferConfig(QueueBufferConfig other)
        copy constructor
    • Method Detail

      • getMaxBatchOpenMs

        public long getMaxBatchOpenMs()
        The maximum time (milliseconds) a send batch is held open for additional outbound requests. The longer this timeout, the longer messages wait for other messages to be added to the batch. Increasing this timeout reduces the number of calls made and increases throughput, but also increases average message latency.
      • setMaxBatchOpenMs

        public void setMaxBatchOpenMs(long maxBatchOpenMs)
        The maximum time (milliseconds) a send batch is held open for additional outbound requests. The longer this timeout, the longer messages wait for other messages to be added to the batch. Increasing this timeout reduces the number of calls made and increases throughput, but also increases average message latency.
      • withMaxBatchOpenMs

        public QueueBufferConfig withMaxBatchOpenMs(long maxBatchOpenMs)
        The maximum time (milliseconds) a send batch is held open for additional outbound requests. The longer this timeout, the longer messages wait for other messages to be added to the batch. Increasing this timeout reduces the number of calls made and increases throughput, but also increases average message latency.
      • isDeleteInBackground

        public boolean isDeleteInBackground()
        If set, even synchronous calls to delete messages will be made using background asynchronous batches. The client will return results indicating that the messages were deleted successfully even if the background calls eventually fail; the actual result of the deletions will be reported through the given handler instead (often just logging errors). This can be beneficial for decreasing message acknowledgement latency at the cost of potential duplicate messages (which can be produced by SQS itself anyway).
      • setDeleteInBackground

        public void setDeleteInBackground(boolean deleteInBackground)
        If set, even synchronous calls to delete messages will be made using background asynchronous batches. The client will return results indicating that the messages were deleted successfully even if the background calls eventually fail; any errors result of the deletions will be reported through the given handler instead (often just logging errors). This can be beneficial for decreasing message acknowledgement latency at the cost of potential duplicate messages (which can be produced by SQS itself anyway).
      • withDeleteInBackground

        public QueueBufferConfig withDeleteInBackground(boolean deleteInBackground)
        If set, even synchronous calls to delete messages will be made using background asynchronous batches. The client will return results indicating that the messages were deleted successfully even if the background calls eventually fail; the actual result of the deletions will be reported through the given handler instead (often just logging errors). This can be beneficial for decreasing message acknowledgement latency at the cost of potential duplicate messages (which can be produced by SQS itself anyway).
      • isLongPoll

        public boolean isLongPoll()
        Returns:
        true if the queue buffer will use long polling while retrieving messages from the SQS server, false otherwise.
      • setLongPoll

        public void setLongPoll(boolean longPoll)
        Specify "true" for receive requests to use long polling.
      • withLongPoll

        public QueueBufferConfig withLongPoll(boolean longPoll)
        Specify "true" for receive requests to use long polling.
      • getMaxInflightOutboundBatches

        public int getMaxInflightOutboundBatches()
        The maximum number of concurrent batches for each type of outbound request. The greater the number, the greater the throughput that can be achieved (at the expense of consuming more threads).
      • setMaxInflightOutboundBatches

        public void setMaxInflightOutboundBatches(int maxInflightOutboundBatches)
        The maximum number of concurrent batches for each type of outbound request. The greater the number, the greater the throughput that can be achieved (at the expense of consuming more threads).
      • withMaxInflightOutboundBatches

        public QueueBufferConfig withMaxInflightOutboundBatches(int maxInflightOutboundBatches)
        The maximum number of concurrent batches for each type of outbound request. The greater the number, the greater the throughput that can be achieved (at the expense of consuming more threads).
      • getMaxInflightReceiveBatches

        public int getMaxInflightReceiveBatches()
        The maximum number of concurrent receive message batches. The greater this number, the faster the queue will be pulling messages from the SQS servers (at the expense of consuming more threads).
      • setMaxInflightReceiveBatches

        public void setMaxInflightReceiveBatches(int maxInflightReceiveBatches)
        The maximum number of concurrent receive message batches. The greater this number, the faster the queue will be pulling messages from the SQS servers (at the expense of consuming more threads).
      • withMaxInflightReceiveBatches

        public QueueBufferConfig withMaxInflightReceiveBatches(int maxInflightReceiveBatches)
        The maximum number of concurrent receive message batches. The greater this number, the faster the queue will be pulling messages from the SQS servers (at the expense of consuming more threads).
      • getMaxDoneReceiveBatches

        public int getMaxDoneReceiveBatches()
        If more than that number of completed receive batches are waiting in the buffer, the querying for new messages will stop.
        The larger this number, the more messages the queue buffer will pre-fetch and keep in the buffer on the client side, and the faster receive requests will be satisfied.
        The visibility timeout of a pre-fetched message starts at the point of pre-fetch, which means that while the message is in the local buffer it is unavailable for other clients to process, and when this client retrieves it, part of the visibility timeout may have already expired.
        The number of messages prefetched will not exceed 10 * maxDoneReceiveBatches, as there can be a maximum of 10 messages per batch.
      • setMaxDoneReceiveBatches

        public void setMaxDoneReceiveBatches(int maxDoneReceiveBatches)
        If more than that number of completed receive batches are waiting in the buffer, the querying for new messages will stop. The larger this number, the more messages the buffer queue will pre-fetch and keep in the buffer on the client side, and the faster receive requests will be satisfied. The visibility timeout of a pre-fetched message starts at the point of pre-fetch, which means that while the message is in the local buffer it is unavailable for other clients to process, and when this client retrieves it, part of the visibility timeout may have already expired. The number of messages prefetched will not exceed maxBatchSize * maxDoneReceiveBatches.
      • withMaxDoneReceiveBatches

        public QueueBufferConfig withMaxDoneReceiveBatches(int maxDoneReceiveBatches)
        If more than that number of completed receive batches are waiting in the buffer, the querying for new messages will stop. The larger this number, the more messages the buffer queue will pre-fetch and keep in the buffer on the client side, and the faster receive requests will be satisfied. The visibility timeout of a pre-fetched message starts at the point of pre-fetch, which means that while the message is in the local buffer it is unavailable for other clients to process, and when this client retrieves it, part of the visibility timeout may have already expired. The number of messages prefetched will not exceed maxBatchSize * maxDoneReceiveBatches.
      • getMaxBatchSizeBytes

        public long getMaxBatchSizeBytes()
        Maximum permitted size of a SendMessage or SendMessageBatch message, in bytes. This setting is also enforced on the server, and if this client submits a request of a size larger than the server can support, the server will reject the request.
      • setMaxBatchSizeBytes

        public void setMaxBatchSizeBytes(long maxBatchSizeBytes)
        Maximum permitted size of a SendMessage or SendMessageBatch message, in bytes. This setting is also enforced on the server, and if this client submits a request of a size larger than the server can support, the server will reject the request.
        Throws:
        IllegalArgumentException - if the size being set is greater than the service allowed size for message body.
      • withMaxBatchSizeBytes

        public QueueBufferConfig withMaxBatchSizeBytes(long maxBatchSizeBytes)
        Maximum permitted size of a SendMessage or SendMessageBatch message, in bytes. This setting is also enforced on the server, and if this client submits a request of a size larger than the server can support, the server will reject the request.
        Throws:
        IllegalArgumentException - if the size being set is greater than the service allowed size for message body.
      • getVisibilityTimeoutSeconds

        public int getVisibilityTimeoutSeconds()
        Custom visibility timeout to use when retrieving messages from SQS. If set to a value greater than zero, this timeout will override the default visibility timeout set on the SQS queue. Set it to -1 to use the default visiblity timeout of the queue. Visibility timeout of 0 seconds is not supported.
      • setVisibilityTimeoutSeconds

        public void setVisibilityTimeoutSeconds(int visibilityTimeoutSeconds)
        Custom visibility timeout to use when retrieving messages from SQS. If set to a value greater than zero, this timeout will override the default visibility timeout set on the SQS queue. Set it to -1 to use the default visiblity timeout of the queue. Visibility timeout of 0 seconds is not supported.
      • withVisibilityTimeoutSeconds

        public QueueBufferConfig withVisibilityTimeoutSeconds(int visibilityTimeoutSeconds)
        Custom visibility timeout to use when retrieving messages from SQS. If set to a value greater than zero, this timeout will override the default visibility timeout set on the SQS queue. Set it to -1 to use the default visiblity timeout of the queue. Visibility timeout of 0 seconds is not supported.
      • setLongPollWaitTimeoutSeconds

        public void setLongPollWaitTimeoutSeconds(int longPollWaitTimeoutSeconds)
        Specifies the amount of time, in seconds, the receive call will block on the server waiting for messages to arrive if the queue is empty when the receive call is first made. This setting has no effect if long polling is disabled.
      • getLongPollWaitTimeoutSeconds

        public int getLongPollWaitTimeoutSeconds()
        Specifies the amount of time, in seconds, the receive call will block on the server waiting for messages to arrive if the queue is empty when the receive call is first made. This setting has no effect if long polling is disabled.
      • withLongPollWaitTimeoutSeconds

        public QueueBufferConfig withLongPollWaitTimeoutSeconds(int longPollWaitTimeoutSeconds)
        Specifies the amount of time, in seconds, the receive call will block on the server waiting for messages to arrive if the queue is empty when the receive call is first made. This setting has no effect if long polling is disabled.
      • getMinReceiveWaitTimeMs

        public int getMinReceiveWaitTimeMs()
        Configures the minimum wait time for incoming receive message requests. Without a non-zero minimum wait time, threads can easily waste CPU time busy-waiting against empty local buffers. Avoid setting this to 0 unless you are confident threads will do useful work in-between each call to receive messages! This will be applied to both requests that explicitly set WaitTimeSeconds and those that inherit the ReceiveMessageWaitTimeSeconds queue attribute.
      • setMinReceiveWaitTimeMs

        public void setMinReceiveWaitTimeMs(int minReceiveWaitTimeMs)
        Configures the minimum wait time for incoming receive message requests. Without a non-zero minimum wait time, threads can easily waste CPU time busy-waiting against empty local buffers. Avoid setting this to 0 unless you are confident threads will do useful work in-between each call to receive messages! This will be applied to both requests that explicitly set WaitTimeSeconds and those that inherit the ReceiveMessageWaitTimeSeconds queue attribute.
      • withMinReceiveWaitTimeMs

        public QueueBufferConfig withMinReceiveWaitTimeMs(int minReceiveWaitTimeMs)
        Configures the minimum wait time for incoming receive message requests. Without a non-zero minimum wait time, threads can easily waste CPU time busy-waiting against empty local buffers. Avoid setting this to 0 unless you are confident threads will do useful work in-between each call to receive messages! This will be applied to both requests that explicitly set WaitTimeSeconds and those that inherit the ReceiveMessageWaitTimeSeconds queue attribute.
      • getMaxBatchSize

        public int getMaxBatchSize()
        Specifies the maximum number of entries the buffered client will put in a single batch request.
      • setMaxBatchSize

        public void setMaxBatchSize(int maxBatchSize)
        Specifies the maximum number of entries the buffered client will put in a single batch request.
      • withMaxBatchSize

        public QueueBufferConfig withMaxBatchSize(int maxBatchSize)
        Specifies the maximum number of entries the buffered client will put in a single batch request.
      • getReceiveAttributeNames

        public List<String> getReceiveAttributeNames()
        Specifies the attributes receive calls will request. Only receive message requests that request the same set of attributes will be satisfied from the receive buffers.

        The default value is an empty list, so any receive requests that require attributes will not be fulfilled from buffers.

      • setReceiveAttributeNames

        public void setReceiveAttributeNames(List<String> receiveAttributeNames)
        Specifies the attributes receive calls will request. Only receive message requests that request the same set of attributes will be satisfied from the receive buffers.

        The default value is an empty list, so any receive requests that require attributes will not be fulfilled from buffers.

      • withReceiveAttributeNames

        public QueueBufferConfig withReceiveAttributeNames(List<String> receiveAttributes)
        Specifies the attributes receive calls will request. Only receive message requests that request the same set of attributes will be satisfied from the receive buffers.

        The default value is an empty list, so any receive requests that require attributes will not be fulfilled from buffers.

      • getReceiveMessageAttributeNames

        public List<String> getReceiveMessageAttributeNames()
        Specifies the message attributes receive calls will request. Only receive message requests that request the same set of attributes will be satisfied from the receive buffers.

        The default value is an empty list, so any receive requests that require message attributes will not be fulfilled from buffers.

      • setReceiveMessageAttributeNames

        public void setReceiveMessageAttributeNames(List<String> receiveMessageAttributeNames)
        Specifies the message attributes receive calls will request. Only receive message requests that request the same set of attributes will be satisfied from the receive buffers.

        The default value is an empty list, so any receive requests that require message attributes will not be fulfilled from buffers.

      • withReceiveMessageAttributeNames

        public QueueBufferConfig withReceiveMessageAttributeNames(List<String> receiveMessageAttributes)
        Specifies the message attributes receive calls will request. Only receive message requests that request the same set of attributes will be satisfied from the receive buffers.

        The default value is an empty list, so any receive requests that require message attributes will not be fulfilled from buffers.

      • setAdaptivePrefetching

        public void setAdaptivePrefetching(boolean adaptivePrefetching)
        If set, prefetching will be scaled with the number of in-flight incoming receive requests made to the client. The advantage of this is reducing the number of outgoing requests made to SQS when incoming requests are reduced: in particular, if all incoming requests stop no future requests to SQS will be made. The disadvantage is increased latency when incoming requests first start occurring.
      • isAdapativePrefetching

        public boolean isAdapativePrefetching()
        If set, prefetching will be scaled with the number of in-flight incoming receive requests made to the client. The advantage of this is reducing the number of outgoing requests made to SQS when incoming requests are reduced: in particular, if all incoming requests stop no future requests to SQS will be made. The disadvantage is increased latency when incoming requests first start occurring.
      • withAdapativePrefetching

        public QueueBufferConfig withAdapativePrefetching(boolean adaptivePrefetching)
        If set, prefetching will be scaled with the number of in-flight incoming receive requests made to the client. The advantage of this is reducing the number of outgoing requests made to SQS when incoming requests are reduced: in particular, if all incoming requests stop no future requests to SQS will be made. The disadvantage is increased latency when incoming requests first start occurring.
      • isFlushOnShutdown

        public boolean isFlushOnShutdown()
        Returns the flushOnShutdown value. The default value is false which indicates flushOnShutdown is disabled. Enabling this option will flush the pending requests in the SendQueueBuffer during shutdown.
        Returns:
        true if flushOnShutdown is enabled, otherwise false.
      • setFlushOnShutdown

        public void setFlushOnShutdown(boolean flushOnShutdown)
        Sets the flushOnShutdown option. The default value is false which indicates flushOnShutdown is disabled. Enabling this option will flush the pending requests in the SendQueueBuffer during shutdown.
        Parameters:
        flushOnShutdown - boolean value to configure flushOnShutdown.
      • withFlushOnShutdown

        public QueueBufferConfig withFlushOnShutdown(boolean flushOnShutdown)
        Sets the flushOnShutdown option. The default value is false which indicates flushOnShutdown is disabled. Enabling this option will flush the pending requests in the SendQueueBuffer during shutdown.
        Parameters:
        flushOnShutdown - boolean value to configure flushOnShutdown.
        Returns:
        This object for method chaining.
Skip navigation links

AltStyle によって変換されたページ (->オリジナル) /