Example usage for com.amazonaws.services.sqs AmazonSQSClient sendMessage

List of usage examples for com.amazonaws.services.sqs AmazonSQSClient sendMessage

Introduction

In this page you can find the example usage for com.amazonaws.services.sqs AmazonSQSClient sendMessage.

Prototype

@Override
    public SendMessageResult sendMessage(String queueUrl, String messageBody) 

Source Link

Usage

From source file:org.finra.dm.dao.impl.SqsOperationsImpl.java

License:Apache License

@Override
public void sendSqsTextMessage(ClientConfiguration clientConfiguration, String queueName, String messageText) {
    try {/*from w w w.j  a v a2 s  .com*/
        AmazonSQSClient amazonSQSClient = new AmazonSQSClient(clientConfiguration);
        GetQueueUrlResult queueUrlResult = amazonSQSClient.getQueueUrl(queueName);
        amazonSQSClient.sendMessage(queueUrlResult.getQueueUrl(), messageText);
    } catch (QueueDoesNotExistException ex) {
        throw new IllegalStateException(String.format("AWS SQS queue with \"%s\" name not found.", queueName),
                ex);
    }
}