/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.sqs.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class ReceiveMessageRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *

* The URL of the Amazon SQS queue from which messages are received. *

*

* Queue URLs and names are case-sensitive. *

*/ private String queueUrl; /** *

* A list of attributes that need to be returned along with each message. These attributes include: *

* */ private com.amazonaws.internal.SdkInternalList attributeNames; /** *

* The name of the message attribute, where N is the index. *

* *

* When using ReceiveMessage, you can send a list of attribute names to receive, or you can return all * of the attributes by specifying All or .* in your request. You can also use all message * attributes starting with a prefix, for example bar.*. *

*/ private com.amazonaws.internal.SdkInternalList messageAttributeNames; /** *

* The maximum number of messages to return. Amazon SQS never returns more messages than this value (however, fewer * messages might be returned). Valid values: 1 to 10. Default: 1. *

*/ private Integer maxNumberOfMessages; /** *

* The duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being * retrieved by a ReceiveMessage request. *

*/ private Integer visibilityTimeout; /** *

* The duration (in seconds) for which the call waits for a message to arrive in the queue before returning. If a * message is available, the call returns sooner than WaitTimeSeconds. If no messages are available and * the wait time expires, the call returns successfully with an empty list of messages. *

* *

* To avoid HTTP errors, ensure that the HTTP response timeout for ReceiveMessage requests is longer * than the WaitTimeSeconds parameter. For example, with the Java SDK, you can set HTTP transport * settings using the * NettyNioAsyncHttpClient for asynchronous clients, or the * ApacheHttpClient for synchronous clients. *

*
*/ private Integer waitTimeSeconds; /** *

* This parameter applies only to FIFO (first-in-first-out) queues. *

*

* The token used for deduplication of ReceiveMessage calls. If a networking issue occurs after a * ReceiveMessage action, and instead of a response you receive a generic error, it is possible to * retry the same action with an identical ReceiveRequestAttemptId to retrieve the same set of * messages, even if their visibility timeout has not yet expired. *

* *

* The maximum length of ReceiveRequestAttemptId is 128 characters. * ReceiveRequestAttemptId can contain alphanumeric characters (a-z, A-Z, * 0-9) and punctuation (!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~). *

*

* For best practices of using ReceiveRequestAttemptId, see Using the ReceiveRequestAttemptId Request Parameter in the Amazon SQS Developer Guide. *

*/ private String receiveRequestAttemptId; /** * Default constructor for ReceiveMessageRequest object. Callers should use the setter or fluent setter (with...) * methods to initialize the object after creating it. */ public ReceiveMessageRequest() { } /** * Constructs a new ReceiveMessageRequest object. Callers should use the setter or fluent setter (with...) methods * to initialize any additional object members. * * @param queueUrl * The URL of the Amazon SQS queue from which messages are received.

*

* Queue URLs and names are case-sensitive. */ public ReceiveMessageRequest(String queueUrl) { setQueueUrl(queueUrl); } /** *

* The URL of the Amazon SQS queue from which messages are received. *

*

* Queue URLs and names are case-sensitive. *

* * @param queueUrl * The URL of the Amazon SQS queue from which messages are received.

*

* Queue URLs and names are case-sensitive. */ public void setQueueUrl(String queueUrl) { this.queueUrl = queueUrl; } /** *

* The URL of the Amazon SQS queue from which messages are received. *

*

* Queue URLs and names are case-sensitive. *

* * @return The URL of the Amazon SQS queue from which messages are received.

*

* Queue URLs and names are case-sensitive. */ public String getQueueUrl() { return this.queueUrl; } /** *

* The URL of the Amazon SQS queue from which messages are received. *

*

* Queue URLs and names are case-sensitive. *

* * @param queueUrl * The URL of the Amazon SQS queue from which messages are received.

*

* Queue URLs and names are case-sensitive. * @return Returns a reference to this object so that method calls can be chained together. */ public ReceiveMessageRequest withQueueUrl(String queueUrl) { setQueueUrl(queueUrl); return this; } /** *

* A list of attributes that need to be returned along with each message. These attributes include: *

* * * @return A list of attributes that need to be returned along with each message. These attributes include:

*