Class ReceiveMessageRequest
- All Implemented Interfaces:
ReadLimitInfo
,Serializable
,Cloneable
- See Also:
-
Field Summary
Fields inherited from class com.amazonaws.AmazonWebServiceRequest
NOOP
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for ReceiveMessageRequest object.ReceiveMessageRequest
(String queueUrl) Constructs a new ReceiveMessageRequest object. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Creates a shallow clone of this request.boolean
A list of attributes that need to be returned along with each message.The maximum number of messages to return.The name of the message attribute, where N is the index.The URL of the Amazon SQS queue to take action on.The duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by aReceiveMessage
request.The duration (in seconds) for which the call will wait for a message to arrive in the queue before returning.int
hashCode()
void
setAttributeNames
(Collection<String> attributeNames) A list of attributes that need to be returned along with each message.void
setMaxNumberOfMessages
(Integer maxNumberOfMessages) The maximum number of messages to return.void
setMessageAttributeNames
(Collection<String> messageAttributeNames) The name of the message attribute, where N is the index.void
setQueueUrl
(String queueUrl) The URL of the Amazon SQS queue to take action on.void
setVisibilityTimeout
(Integer visibilityTimeout) The duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by aReceiveMessage
request.void
setWaitTimeSeconds
(Integer waitTimeSeconds) The duration (in seconds) for which the call will wait for a message to arrive in the queue before returning.toString()
Returns a string representation of this object; useful for testing and debugging.withAttributeNames
(QueueAttributeName... attributeNames) A list of attributes that need to be returned along with each message.withAttributeNames
(String... attributeNames) A list of attributes that need to be returned along with each message.withAttributeNames
(Collection<String> attributeNames) A list of attributes that need to be returned along with each message.withMaxNumberOfMessages
(Integer maxNumberOfMessages) The maximum number of messages to return.withMessageAttributeNames
(String... messageAttributeNames) The name of the message attribute, where N is the index.withMessageAttributeNames
(Collection<String> messageAttributeNames) The name of the message attribute, where N is the index.withQueueUrl
(String queueUrl) The URL of the Amazon SQS queue to take action on.withVisibilityTimeout
(Integer visibilityTimeout) The duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by aReceiveMessage
request.withWaitTimeSeconds
(Integer waitTimeSeconds) The duration (in seconds) for which the call will wait for a message to arrive in the queue before returning.Methods inherited from class com.amazonaws.AmazonWebServiceRequest
copyBaseTo, getCloneRoot, getCloneSource, getCustomQueryParameters, getCustomRequestHeaders, getGeneralProgressListener, getReadLimit, getRequestClientOptions, getRequestCredentials, getRequestCredentialsProvider, getRequestMetricCollector, getSdkClientExecutionTimeout, getSdkRequestTimeout, putCustomQueryParameter, putCustomRequestHeader, setGeneralProgressListener, setRequestCredentials, setRequestCredentialsProvider, setRequestMetricCollector, setSdkClientExecutionTimeout, setSdkRequestTimeout, withGeneralProgressListener, withRequestMetricCollector, withSdkClientExecutionTimeout, withSdkRequestTimeout
-
Constructor Details
-
ReceiveMessageRequest
public ReceiveMessageRequest()Default constructor for ReceiveMessageRequest object. Callers should use the setter or fluent setter (with...) methods to initialize the object after creating it. -
ReceiveMessageRequest
Constructs a new ReceiveMessageRequest object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.- Parameters:
queueUrl
- The URL of the Amazon SQS queue to take action on.Queue URLs are case-sensitive.
-
-
Method Details
-
setQueueUrl
The URL of the Amazon SQS queue to take action on.
Queue URLs are case-sensitive.
- Parameters:
queueUrl
- The URL of the Amazon SQS queue to take action on.Queue URLs are case-sensitive.
-
getQueueUrl
The URL of the Amazon SQS queue to take action on.
Queue URLs are case-sensitive.
- Returns:
- The URL of the Amazon SQS queue to take action on.
Queue URLs are case-sensitive.
-
withQueueUrl
The URL of the Amazon SQS queue to take action on.
Queue URLs are case-sensitive.
- Parameters:
queueUrl
- The URL of the Amazon SQS queue to take action on.Queue URLs are case-sensitive.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
getAttributeNames
A list of attributes that need to be returned along with each message. These attributes include:
-
All
- returns all values. -
ApproximateFirstReceiveTimestamp
- returns the time when the message was first received from the queue (epoch time in milliseconds). -
ApproximateReceiveCount
- returns the number of times a message has been received from the queue but not deleted. -
SenderId
- returns the AWS account number (or the IP address, if anonymous access is allowed) of the sender. -
SentTimestamp
- returns the time when the message was sent to the queue (epoch time in milliseconds).
Any other valid special request parameters that are specified (such as
ApproximateNumberOfMessages
,ApproximateNumberOfMessagesDelayed
,ApproximateNumberOfMessagesNotVisible
,CreatedTimestamp
,DelaySeconds
,LastModifiedTimestamp
,MaximumMessageSize
,MessageRetentionPeriod
,Policy
,QueueArn
,ReceiveMessageWaitTimeSeconds
,RedrivePolicy
, andVisibilityTimeout
) will be ignored.- Returns:
- A list of attributes that need to be returned along with each
message. These attributes include:
-
All
- returns all values. -
ApproximateFirstReceiveTimestamp
- returns the time when the message was first received from the queue (epoch time in milliseconds). -
ApproximateReceiveCount
- returns the number of times a message has been received from the queue but not deleted. -
SenderId
- returns the AWS account number (or the IP address, if anonymous access is allowed) of the sender. -
SentTimestamp
- returns the time when the message was sent to the queue (epoch time in milliseconds).
Any other valid special request parameters that are specified (such as
ApproximateNumberOfMessages
,ApproximateNumberOfMessagesDelayed
,ApproximateNumberOfMessagesNotVisible
,CreatedTimestamp
,DelaySeconds
,LastModifiedTimestamp
,MaximumMessageSize
,MessageRetentionPeriod
,Policy
,QueueArn
,ReceiveMessageWaitTimeSeconds
,RedrivePolicy
, andVisibilityTimeout
) will be ignored. -
- See Also:
-
-
setAttributeNames
A list of attributes that need to be returned along with each message. These attributes include:
-
All
- returns all values. -
ApproximateFirstReceiveTimestamp
- returns the time when the message was first received from the queue (epoch time in milliseconds). -
ApproximateReceiveCount
- returns the number of times a message has been received from the queue but not deleted. -
SenderId
- returns the AWS account number (or the IP address, if anonymous access is allowed) of the sender. -
SentTimestamp
- returns the time when the message was sent to the queue (epoch time in milliseconds).
Any other valid special request parameters that are specified (such as
ApproximateNumberOfMessages
,ApproximateNumberOfMessagesDelayed
,ApproximateNumberOfMessagesNotVisible
,CreatedTimestamp
,DelaySeconds
,LastModifiedTimestamp
,MaximumMessageSize
,MessageRetentionPeriod
,Policy
,QueueArn
,ReceiveMessageWaitTimeSeconds
,RedrivePolicy
, andVisibilityTimeout
) will be ignored.- Parameters:
attributeNames
- A list of attributes that need to be returned along with each message. These attributes include:-
All
- returns all values. -
ApproximateFirstReceiveTimestamp
- returns the time when the message was first received from the queue (epoch time in milliseconds). -
ApproximateReceiveCount
- returns the number of times a message has been received from the queue but not deleted. -
SenderId
- returns the AWS account number (or the IP address, if anonymous access is allowed) of the sender. -
SentTimestamp
- returns the time when the message was sent to the queue (epoch time in milliseconds).
Any other valid special request parameters that are specified (such as
ApproximateNumberOfMessages
,ApproximateNumberOfMessagesDelayed
,ApproximateNumberOfMessagesNotVisible
,CreatedTimestamp
,DelaySeconds
,LastModifiedTimestamp
,MaximumMessageSize
,MessageRetentionPeriod
,Policy
,QueueArn
,ReceiveMessageWaitTimeSeconds
,RedrivePolicy
, andVisibilityTimeout
) will be ignored.-
- See Also:
-
-
withAttributeNames
A list of attributes that need to be returned along with each message. These attributes include:
-
All
- returns all values. -
ApproximateFirstReceiveTimestamp
- returns the time when the message was first received from the queue (epoch time in milliseconds). -
ApproximateReceiveCount
- returns the number of times a message has been received from the queue but not deleted. -
SenderId
- returns the AWS account number (or the IP address, if anonymous access is allowed) of the sender. -
SentTimestamp
- returns the time when the message was sent to the queue (epoch time in milliseconds).
Any other valid special request parameters that are specified (such as
ApproximateNumberOfMessages
,ApproximateNumberOfMessagesDelayed
,ApproximateNumberOfMessagesNotVisible
,CreatedTimestamp
,DelaySeconds
,LastModifiedTimestamp
,MaximumMessageSize
,MessageRetentionPeriod
,Policy
,QueueArn
,ReceiveMessageWaitTimeSeconds
,RedrivePolicy
, andVisibilityTimeout
) will be ignored.NOTE: This method appends the values to the existing list (if any). Use
setAttributeNames(java.util.Collection)
orwithAttributeNames(java.util.Collection)
if you want to override the existing values.- Parameters:
attributeNames
- A list of attributes that need to be returned along with each message. These attributes include:-
All
- returns all values. -
ApproximateFirstReceiveTimestamp
- returns the time when the message was first received from the queue (epoch time in milliseconds). -
ApproximateReceiveCount
- returns the number of times a message has been received from the queue but not deleted. -
SenderId
- returns the AWS account number (or the IP address, if anonymous access is allowed) of the sender. -
SentTimestamp
- returns the time when the message was sent to the queue (epoch time in milliseconds).
Any other valid special request parameters that are specified (such as
ApproximateNumberOfMessages
,ApproximateNumberOfMessagesDelayed
,ApproximateNumberOfMessagesNotVisible
,CreatedTimestamp
,DelaySeconds
,LastModifiedTimestamp
,MaximumMessageSize
,MessageRetentionPeriod
,Policy
,QueueArn
,ReceiveMessageWaitTimeSeconds
,RedrivePolicy
, andVisibilityTimeout
) will be ignored.-
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-
-
withAttributeNames
A list of attributes that need to be returned along with each message. These attributes include:
-
All
- returns all values. -
ApproximateFirstReceiveTimestamp
- returns the time when the message was first received from the queue (epoch time in milliseconds). -
ApproximateReceiveCount
- returns the number of times a message has been received from the queue but not deleted. -
SenderId
- returns the AWS account number (or the IP address, if anonymous access is allowed) of the sender. -
SentTimestamp
- returns the time when the message was sent to the queue (epoch time in milliseconds).
Any other valid special request parameters that are specified (such as
ApproximateNumberOfMessages
,ApproximateNumberOfMessagesDelayed
,ApproximateNumberOfMessagesNotVisible
,CreatedTimestamp
,DelaySeconds
,LastModifiedTimestamp
,MaximumMessageSize
,MessageRetentionPeriod
,Policy
,QueueArn
,ReceiveMessageWaitTimeSeconds
,RedrivePolicy
, andVisibilityTimeout
) will be ignored.- Parameters:
attributeNames
- A list of attributes that need to be returned along with each message. These attributes include:-
All
- returns all values. -
ApproximateFirstReceiveTimestamp
- returns the time when the message was first received from the queue (epoch time in milliseconds). -
ApproximateReceiveCount
- returns the number of times a message has been received from the queue but not deleted. -
SenderId
- returns the AWS account number (or the IP address, if anonymous access is allowed) of the sender. -
SentTimestamp
- returns the time when the message was sent to the queue (epoch time in milliseconds).
Any other valid special request parameters that are specified (such as
ApproximateNumberOfMessages
,ApproximateNumberOfMessagesDelayed
,ApproximateNumberOfMessagesNotVisible
,CreatedTimestamp
,DelaySeconds
,LastModifiedTimestamp
,MaximumMessageSize
,MessageRetentionPeriod
,Policy
,QueueArn
,ReceiveMessageWaitTimeSeconds
,RedrivePolicy
, andVisibilityTimeout
) will be ignored.-
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-
-
withAttributeNames
A list of attributes that need to be returned along with each message. These attributes include:
-
All
- returns all values. -
ApproximateFirstReceiveTimestamp
- returns the time when the message was first received from the queue (epoch time in milliseconds). -
ApproximateReceiveCount
- returns the number of times a message has been received from the queue but not deleted. -
SenderId
- returns the AWS account number (or the IP address, if anonymous access is allowed) of the sender. -
SentTimestamp
- returns the time when the message was sent to the queue (epoch time in milliseconds).
Any other valid special request parameters that are specified (such as
ApproximateNumberOfMessages
,ApproximateNumberOfMessagesDelayed
,ApproximateNumberOfMessagesNotVisible
,CreatedTimestamp
,DelaySeconds
,LastModifiedTimestamp
,MaximumMessageSize
,MessageRetentionPeriod
,Policy
,QueueArn
,ReceiveMessageWaitTimeSeconds
,RedrivePolicy
, andVisibilityTimeout
) will be ignored.- Parameters:
attributeNames
- A list of attributes that need to be returned along with each message. These attributes include:-
All
- returns all values. -
ApproximateFirstReceiveTimestamp
- returns the time when the message was first received from the queue (epoch time in milliseconds). -
ApproximateReceiveCount
- returns the number of times a message has been received from the queue but not deleted. -
SenderId
- returns the AWS account number (or the IP address, if anonymous access is allowed) of the sender. -
SentTimestamp
- returns the time when the message was sent to the queue (epoch time in milliseconds).
Any other valid special request parameters that are specified (such as
ApproximateNumberOfMessages
,ApproximateNumberOfMessagesDelayed
,ApproximateNumberOfMessagesNotVisible
,CreatedTimestamp
,DelaySeconds
,LastModifiedTimestamp
,MaximumMessageSize
,MessageRetentionPeriod
,Policy
,QueueArn
,ReceiveMessageWaitTimeSeconds
,RedrivePolicy
, andVisibilityTimeout
) will be ignored.-
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-
-
getMessageAttributeNames
The name of the message attribute, where N is the index. The message attribute name can contain the following characters: A-Z, a-z, 0-9, underscore (_), hyphen (-), and period (.). The name must not start or end with a period, and it should not have successive periods. The name is case sensitive and must be unique among all attribute names for the message. The name can be up to 256 characters long. The name cannot start with "AWS." or "Amazon." (or any variations in casing), because these prefixes are reserved for use by Amazon Web Services.
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 "bar.*" to return all message attributes starting with the "bar" prefix.- Returns:
- The name of the message attribute, where N is the index.
The message attribute name can contain the following characters:
A-Z, a-z, 0-9, underscore (_), hyphen (-), and period (.). The
name must not start or end with a period, and it should not have
successive periods. The name is case sensitive and must be unique
among all attribute names for the message. The name can be up to
256 characters long. The name cannot start with "AWS." or
"Amazon." (or any variations in casing), because these prefixes
are reserved for use by Amazon Web Services.
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 "bar.*" to return all message attributes starting with the "bar" prefix.
-
setMessageAttributeNames
The name of the message attribute, where N is the index. The message attribute name can contain the following characters: A-Z, a-z, 0-9, underscore (_), hyphen (-), and period (.). The name must not start or end with a period, and it should not have successive periods. The name is case sensitive and must be unique among all attribute names for the message. The name can be up to 256 characters long. The name cannot start with "AWS." or "Amazon." (or any variations in casing), because these prefixes are reserved for use by Amazon Web Services.
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 "bar.*" to return all message attributes starting with the "bar" prefix.- Parameters:
messageAttributeNames
- The name of the message attribute, where N is the index. The message attribute name can contain the following characters: A-Z, a-z, 0-9, underscore (_), hyphen (-), and period (.). The name must not start or end with a period, and it should not have successive periods. The name is case sensitive and must be unique among all attribute names for the message. The name can be up to 256 characters long. The name cannot start with "AWS." or "Amazon." (or any variations in casing), because these prefixes are reserved for use by Amazon Web Services.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 "bar.*" to return all message attributes starting with the "bar" prefix.
-
withMessageAttributeNames
The name of the message attribute, where N is the index. The message attribute name can contain the following characters: A-Z, a-z, 0-9, underscore (_), hyphen (-), and period (.). The name must not start or end with a period, and it should not have successive periods. The name is case sensitive and must be unique among all attribute names for the message. The name can be up to 256 characters long. The name cannot start with "AWS." or "Amazon." (or any variations in casing), because these prefixes are reserved for use by Amazon Web Services.
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 "bar.*" to return all message attributes starting with the "bar" prefix.NOTE: This method appends the values to the existing list (if any). Use
setMessageAttributeNames(java.util.Collection)
orwithMessageAttributeNames(java.util.Collection)
if you want to override the existing values.- Parameters:
messageAttributeNames
- The name of the message attribute, where N is the index. The message attribute name can contain the following characters: A-Z, a-z, 0-9, underscore (_), hyphen (-), and period (.). The name must not start or end with a period, and it should not have successive periods. The name is case sensitive and must be unique among all attribute names for the message. The name can be up to 256 characters long. The name cannot start with "AWS." or "Amazon." (or any variations in casing), because these prefixes are reserved for use by Amazon Web Services.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 "bar.*" to return all message attributes starting with the "bar" prefix.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
withMessageAttributeNames
The name of the message attribute, where N is the index. The message attribute name can contain the following characters: A-Z, a-z, 0-9, underscore (_), hyphen (-), and period (.). The name must not start or end with a period, and it should not have successive periods. The name is case sensitive and must be unique among all attribute names for the message. The name can be up to 256 characters long. The name cannot start with "AWS." or "Amazon." (or any variations in casing), because these prefixes are reserved for use by Amazon Web Services.
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 "bar.*" to return all message attributes starting with the "bar" prefix.- Parameters:
messageAttributeNames
- The name of the message attribute, where N is the index. The message attribute name can contain the following characters: A-Z, a-z, 0-9, underscore (_), hyphen (-), and period (.). The name must not start or end with a period, and it should not have successive periods. The name is case sensitive and must be unique among all attribute names for the message. The name can be up to 256 characters long. The name cannot start with "AWS." or "Amazon." (or any variations in casing), because these prefixes are reserved for use by Amazon Web Services.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 "bar.*" to return all message attributes starting with the "bar" prefix.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setMaxNumberOfMessages
The maximum number of messages to return. Amazon SQS never returns more messages than this value but may return fewer. Values can be from 1 to 10. Default is 1.
All of the messages are not necessarily returned.
- Parameters:
maxNumberOfMessages
- The maximum number of messages to return. Amazon SQS never returns more messages than this value but may return fewer. Values can be from 1 to 10. Default is 1.All of the messages are not necessarily returned.
-
getMaxNumberOfMessages
The maximum number of messages to return. Amazon SQS never returns more messages than this value but may return fewer. Values can be from 1 to 10. Default is 1.
All of the messages are not necessarily returned.
- Returns:
- The maximum number of messages to return. Amazon SQS never
returns more messages than this value but may return fewer.
Values can be from 1 to 10. Default is 1.
All of the messages are not necessarily returned.
-
withMaxNumberOfMessages
The maximum number of messages to return. Amazon SQS never returns more messages than this value but may return fewer. Values can be from 1 to 10. Default is 1.
All of the messages are not necessarily returned.
- Parameters:
maxNumberOfMessages
- The maximum number of messages to return. Amazon SQS never returns more messages than this value but may return fewer. Values can be from 1 to 10. Default is 1.All of the messages are not necessarily returned.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setVisibilityTimeout
The duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by a
ReceiveMessage
request.- Parameters:
visibilityTimeout
- The duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by aReceiveMessage
request.
-
getVisibilityTimeout
The duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by a
ReceiveMessage
request.- Returns:
- The duration (in seconds) that the received messages are hidden
from subsequent retrieve requests after being retrieved by a
ReceiveMessage
request.
-
withVisibilityTimeout
The duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by a
ReceiveMessage
request.- Parameters:
visibilityTimeout
- The duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by aReceiveMessage
request.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setWaitTimeSeconds
The duration (in seconds) for which the call will wait for a message to arrive in the queue before returning. If a message is available, the call will return sooner than WaitTimeSeconds.
- Parameters:
waitTimeSeconds
- The duration (in seconds) for which the call will wait for a message to arrive in the queue before returning. If a message is available, the call will return sooner than WaitTimeSeconds.
-
getWaitTimeSeconds
The duration (in seconds) for which the call will wait for a message to arrive in the queue before returning. If a message is available, the call will return sooner than WaitTimeSeconds.
- Returns:
- The duration (in seconds) for which the call will wait for a message to arrive in the queue before returning. If a message is available, the call will return sooner than WaitTimeSeconds.
-
withWaitTimeSeconds
The duration (in seconds) for which the call will wait for a message to arrive in the queue before returning. If a message is available, the call will return sooner than WaitTimeSeconds.
- Parameters:
waitTimeSeconds
- The duration (in seconds) for which the call will wait for a message to arrive in the queue before returning. If a message is available, the call will return sooner than WaitTimeSeconds.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
toString
Returns a string representation of this object; useful for testing and debugging. -
equals
-
hashCode
public int hashCode() -
clone
Description copied from class:AmazonWebServiceRequest
Creates a shallow clone of this request. Explicitly does not clone the deep structure of the request object.- Overrides:
clone
in classAmazonWebServiceRequest
- See Also:
-