public class AmazonSQSMessagingClientWrapper extends Object
AmazonSQSClient. This class changes all
AmazonServiceException and AmazonClientException into
JMSException/JMSSecurityException.| Constructor and Description |
|---|
AmazonSQSMessagingClientWrapper(com.amazonaws.services.sqs.AmazonSQS amazonSQSClient) |
AmazonSQSMessagingClientWrapper(com.amazonaws.services.sqs.AmazonSQS amazonSQSClient,
com.amazonaws.auth.AWSCredentialsProvider credentialsProvider) |
| Modifier and Type | Method and Description |
|---|---|
void |
changeMessageVisibility(com.amazonaws.services.sqs.model.ChangeMessageVisibilityRequest changeMessageVisibilityRequest)
Calls
changeMessageVisibility and wraps AmazonClientException. |
com.amazonaws.services.sqs.model.ChangeMessageVisibilityBatchResult |
changeMessageVisibilityBatch(com.amazonaws.services.sqs.model.ChangeMessageVisibilityBatchRequest changeMessageVisibilityBatchRequest)
Calls
changeMessageVisibilityBatch and wraps AmazonClientException. |
com.amazonaws.services.sqs.model.CreateQueueResult |
createQueue(com.amazonaws.services.sqs.model.CreateQueueRequest createQueueRequest)
Calls
createQueue to create the queue with the provided queue attributes
if any, and wraps AmazonClientException |
com.amazonaws.services.sqs.model.CreateQueueResult |
createQueue(String queueName)
Calls
createQueue to create the queue with the default queue attributes,
and wraps AmazonClientException |
void |
deleteMessage(com.amazonaws.services.sqs.model.DeleteMessageRequest deleteMessageRequest)
Calls
deleteMessage and wraps AmazonClientException. |
com.amazonaws.services.sqs.model.DeleteMessageBatchResult |
deleteMessageBatch(com.amazonaws.services.sqs.model.DeleteMessageBatchRequest deleteMessageBatchRequest)
Calls
deleteMessageBatch and wraps
AmazonClientException. |
com.amazonaws.services.sqs.AmazonSQS |
getAmazonSQSClient()
If one uses any other AWS SDK operations other than explicitly listed
here, the exceptions thrown by those operations will not be wrapped as
JMSException. |
com.amazonaws.services.sqs.model.GetQueueUrlResult |
getQueueUrl(com.amazonaws.services.sqs.model.GetQueueUrlRequest getQueueUrlRequest)
Calls
getQueueUrl and wraps AmazonClientException |
com.amazonaws.services.sqs.model.GetQueueUrlResult |
getQueueUrl(String queueName)
Gets the queueUrl of a queue given a queue name.
|
com.amazonaws.services.sqs.model.GetQueueUrlResult |
getQueueUrl(String queueName,
String queueOwnerAccountId)
Gets the queueUrl of a queue given a queue name owned by the provided accountId.
|
boolean |
queueExists(String queueName)
Check if the requested queue exists.
|
boolean |
queueExists(String queueName,
String queueOwnerAccountId)
Check if the requested queue exists.
|
com.amazonaws.services.sqs.model.ReceiveMessageResult |
receiveMessage(com.amazonaws.services.sqs.model.ReceiveMessageRequest receiveMessageRequest)
Calls
receiveMessage and wraps AmazonClientException. |
com.amazonaws.services.sqs.model.SendMessageResult |
sendMessage(com.amazonaws.services.sqs.model.SendMessageRequest sendMessageRequest)
Calls
sendMessage and wraps
AmazonClientException. |
void |
setEndpoint(String endpoint)
Deprecated.
|
void |
setRegion(com.amazonaws.regions.Region region)
Deprecated.
|
public AmazonSQSMessagingClientWrapper(com.amazonaws.services.sqs.AmazonSQS amazonSQSClient)
throws javax.jms.JMSException
amazonSQSClient - The AWS SDK Client for SQS.javax.jms.JMSException - if the client is nullpublic AmazonSQSMessagingClientWrapper(com.amazonaws.services.sqs.AmazonSQS amazonSQSClient,
com.amazonaws.auth.AWSCredentialsProvider credentialsProvider)
throws javax.jms.JMSException
amazonSQSClient - The AWS SDK Client for SQS.javax.jms.JMSException - if the client is nullpublic com.amazonaws.services.sqs.AmazonSQS getAmazonSQSClient()
JMSException.@Deprecated public void setEndpoint(String endpoint) throws javax.jms.JMSException
endpoint - The endpoint (ex: "sqs.us-east-1.amazonaws.com") of the region
specific AWS endpoint this client will communicate with.javax.jms.JMSException@Deprecated public void setRegion(com.amazonaws.regions.Region region) throws javax.jms.JMSException
IllegalArgumentException.
Deprecated. Instead of manipulating settings of existing AmazonSQS client, provide correct configuration when creating it through SQSConnectionFactory constructors.region - The region this client will communicate with. See
Region.getRegion(com.amazonaws.regions.Regions) for
accessing a given region.javax.jms.JMSExceptionpublic void deleteMessage(com.amazonaws.services.sqs.model.DeleteMessageRequest deleteMessageRequest)
throws javax.jms.JMSException
deleteMessage and wraps AmazonClientException. This is used to
acknowledge single messages, so that they can be deleted from SQS queue.deleteMessageRequest - Container for the necessary parameters to execute the
deleteMessage service method on AmazonSQS.javax.jms.JMSExceptionpublic com.amazonaws.services.sqs.model.DeleteMessageBatchResult deleteMessageBatch(com.amazonaws.services.sqs.model.DeleteMessageBatchRequest deleteMessageBatchRequest)
throws javax.jms.JMSException
deleteMessageBatch and wraps
AmazonClientException. This is used to acknowledge multiple
messages on client_acknowledge mode, so that they can be deleted from SQS
queue.deleteMessageBatchRequest - Container for the necessary parameters to execute the
deleteMessageBatch service method on AmazonSQS. This is the
batch version of deleteMessage. Max batch size is 10.javax.jms.JMSExceptionpublic com.amazonaws.services.sqs.model.SendMessageResult sendMessage(com.amazonaws.services.sqs.model.SendMessageRequest sendMessageRequest)
throws javax.jms.JMSException
sendMessage and wraps
AmazonClientException.sendMessageRequest - Container for the necessary parameters to execute the
sendMessage service method on AmazonSQS.javax.jms.JMSExceptionpublic boolean queueExists(String queueName) throws javax.jms.JMSException
GetQueueUrl for the given queue name, returning true on
success, false if it gets QueueDoesNotExistException.queueName - the queue to checkjavax.jms.JMSExceptionpublic boolean queueExists(String queueName, String queueOwnerAccountId) throws javax.jms.JMSException
GetQueueUrl for the given queue name with the given owner
accountId, returning true on success, false if it gets
QueueDoesNotExistException.queueName - the queue to checkqueueOwnerAccountId - The AWS accountId of the account that created the queuejavax.jms.JMSExceptionpublic com.amazonaws.services.sqs.model.GetQueueUrlResult getQueueUrl(String queueName) throws javax.jms.JMSException
queueName - javax.jms.JMSExceptionpublic com.amazonaws.services.sqs.model.GetQueueUrlResult getQueueUrl(String queueName, String queueOwnerAccountId) throws javax.jms.JMSException
queueName - queueOwnerAccountId - The AWS accountId of the account that created the queuejavax.jms.JMSExceptionpublic com.amazonaws.services.sqs.model.GetQueueUrlResult getQueueUrl(com.amazonaws.services.sqs.model.GetQueueUrlRequest getQueueUrlRequest)
throws javax.jms.JMSException
getQueueUrl and wraps AmazonClientExceptiongetQueueUrlRequest - Container for the necessary parameters to execute the
getQueueUrl service method on AmazonSQS.javax.jms.JMSExceptionpublic com.amazonaws.services.sqs.model.CreateQueueResult createQueue(String queueName) throws javax.jms.JMSException
createQueue to create the queue with the default queue attributes,
and wraps AmazonClientExceptionqueueName - javax.jms.JMSExceptionpublic com.amazonaws.services.sqs.model.CreateQueueResult createQueue(com.amazonaws.services.sqs.model.CreateQueueRequest createQueueRequest)
throws javax.jms.JMSException
createQueue to create the queue with the provided queue attributes
if any, and wraps AmazonClientExceptioncreateQueueRequest - Container for the necessary parameters to execute the
createQueue service method on AmazonSQS.javax.jms.JMSExceptionpublic com.amazonaws.services.sqs.model.ReceiveMessageResult receiveMessage(com.amazonaws.services.sqs.model.ReceiveMessageRequest receiveMessageRequest)
throws javax.jms.JMSException
receiveMessage and wraps AmazonClientException. Used by
SQSMessageConsumerPrefetch to receive up to minimum of
(numberOfMessagesToPrefetch,10) messages from SQS queue into consumer
prefetch buffers.receiveMessageRequest - Container for the necessary parameters to execute the
receiveMessage service method on AmazonSQS.javax.jms.JMSExceptionpublic void changeMessageVisibility(com.amazonaws.services.sqs.model.ChangeMessageVisibilityRequest changeMessageVisibilityRequest)
throws javax.jms.JMSException
changeMessageVisibility and wraps AmazonClientException. This is
used to for negative acknowledge of a single message, so that messages can be received again without any delay.changeMessageVisibilityRequest - Container for the necessary parameters to execute the
changeMessageVisibility service method on AmazonSQS.javax.jms.JMSExceptionpublic com.amazonaws.services.sqs.model.ChangeMessageVisibilityBatchResult changeMessageVisibilityBatch(com.amazonaws.services.sqs.model.ChangeMessageVisibilityBatchRequest changeMessageVisibilityBatchRequest)
throws javax.jms.JMSException
changeMessageVisibilityBatch and wraps AmazonClientException. This is
used to for negative acknowledge of messages in batch, so that messages
can be received again without any delay.changeMessageVisibilityBatchRequest - Container for the necessary parameters to execute the
changeMessageVisibilityBatch service method on AmazonSQS.javax.jms.JMSExceptionCopyright © 2022. All rights reserved.