Interface AmazonSQSManager
-
- All Known Implementing Classes:
DefaultAmazonSQSManager
public interface AmazonSQSManager
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetRpcReplyQueueNameAndCreateIfNecessary(java.lang.String moduleId, java.lang.String location)Retrieve the queue name to use for RPC replies from a specific RPC Module and location.java.lang.StringgetRpcRequestQueueNameAndCreateIfNecessary(java.lang.String moduleId, java.lang.String location)Retrieve the queue name to use for RPC request targetting a specific RPC Module and location.java.lang.StringgetSinkQueueUrlAndCreateIfNecessary(java.lang.String moduleId)Retrieve the queue URL for the given Sink Module and create the queue if it does not already exist.com.amazonaws.services.sqs.AmazonSQSgetSQSClient()Retrieve the underlying SQS client.com.amazon.sqs.javamessaging.SQSConnectionFactorygetSQSConnectionFactory()Retrieve a connection factory that wraps the SQS client as a JMS provider.java.lang.StringsendMessage(java.lang.String queueUrl, java.lang.String body)Send message.
-
-
-
Method Detail
-
getSQSClient
com.amazonaws.services.sqs.AmazonSQS getSQSClient()
Retrieve the underlying SQS client.- Returns:
- the sqs client
-
getSQSConnectionFactory
com.amazon.sqs.javamessaging.SQSConnectionFactory getSQSConnectionFactory()
Retrieve a connection factory that wraps the SQS client as a JMS provider.- Returns:
- the JMS connection factory
-
getSinkQueueUrlAndCreateIfNecessary
java.lang.String getSinkQueueUrlAndCreateIfNecessary(java.lang.String moduleId) throws java.lang.InterruptedExceptionRetrieve the queue URL for the given Sink Module and create the queue if it does not already exist.This is a blocking operation. If AWS is unreachable, the method will keep retrying indefinitely until the queue is created and the queue URL is determined, or the thread is interrupted.
This function may cache the queue URL, avoiding unecesssary API calls.
- Parameters:
moduleId- the ID of the Sink Module- Returns:
- the queue URL
- Throws:
java.lang.InterruptedException
-
getRpcRequestQueueNameAndCreateIfNecessary
java.lang.String getRpcRequestQueueNameAndCreateIfNecessary(java.lang.String moduleId, java.lang.String location) throws AmazonSQSQueueExceptionRetrieve the queue name to use for RPC request targetting a specific RPC Module and location. Also create the queue if it does not already exist.This function may cache the queue URL, avoiding unecesssary API calls.
- Parameters:
moduleId- the ID of the RPC Modulelocation- the targetted location of the request- Returns:
- the queue name
- Throws:
AmazonSQSQueueException- if some error occured creating the queue or determining the URL
-
getRpcReplyQueueNameAndCreateIfNecessary
java.lang.String getRpcReplyQueueNameAndCreateIfNecessary(java.lang.String moduleId, java.lang.String location) throws AmazonSQSQueueExceptionRetrieve the queue name to use for RPC replies from a specific RPC Module and location. Also create the queue if it does not already exist.This function may cache the queue URL, avoiding unecesssary API calls.
- Parameters:
moduleId- the ID of the RPC Modulelocation- the source location of the reply- Returns:
- the queue name
- Throws:
AmazonSQSQueueException- if some error occured creating the queue or determining the URL
-
sendMessage
java.lang.String sendMessage(java.lang.String queueUrl, java.lang.String body) throws java.lang.InterruptedExceptionSend message.This is a blocking operation. If AWS is unreachable, the method will keep retrying indefinitely until the message is delivered or the thread is interrupted.
- Parameters:
queueUrl- the queue URLbody- the message body- Returns:
- the message ID
- Throws:
java.lang.InterruptedException
-
-