Example usage for com.amazonaws.services.sqs.model SendMessageBatchRequest SendMessageBatchRequest

List of usage examples for com.amazonaws.services.sqs.model SendMessageBatchRequest SendMessageBatchRequest

Introduction

In this page you can find the example usage for com.amazonaws.services.sqs.model SendMessageBatchRequest SendMessageBatchRequest.

Prototype

public SendMessageBatchRequest(String queueUrl, java.util.List<SendMessageBatchRequestEntry> entries) 

Source Link

Document

Constructs a new SendMessageBatchRequest object.

Usage

From source file:com.amazon.sqs.javamessaging.AmazonSQSExtendedClient.java

License:Open Source License

/**
 * <p>/* www  .  j a  v  a  2  s.  c  om*/
 * Delivers up to ten messages to the specified queue. This is a batch
 * version of SendMessage. The result of the send action on each message is
 * reported individually in the response. Uploads message payloads to Amazon
 * S3 when necessary.
 * </p>
 * <p>
 * If the <code>DelaySeconds</code> parameter is not specified for an entry,
 * the default for the queue is used.
 * </p>
 * <p>
 * <b>IMPORTANT:</b>The following list shows the characters (in Unicode)
 * that are allowed in your message, according to the W3C XML specification.
 * For more information, go to http://www.faqs.org/rfcs/rfc1321.html. If you
 * send any characters that are not included in the list, your request will
 * be rejected. #x9 | #xA | #xD | [#x20 to #xD7FF] | [#xE000 to #xFFFD] |
 * [#x10000 to #x10FFFF]
 * </p>
 * <p>
 * <b>IMPORTANT:</b> Because the batch request can result in a combination
 * of successful and unsuccessful actions, you should check for batch errors
 * even when the call returns an HTTP status code of 200.
 * </p>
 * <p>
 * <b>NOTE:</b>Some API actions take lists of parameters. These lists are
 * specified using the param.n notation. Values of n are integers starting
 * from 1. For example, a parameter list with two elements looks like this:
 * </p>
 * <p>
 * <code>&Attribute.1=this</code>
 * </p>
 * <p>
 * <code>&Attribute.2=that</code>
 * </p>
 * 
 * @param queueUrl
 *            The URL of the Amazon SQS queue to take action on.
 * @param entries
 *            A list of <a>SendMessageBatchRequestEntry</a> items.
 * 
 * @return The response from the SendMessageBatch service method, as
 *         returned by AmazonSQS.
 * 
 * @throws BatchEntryIdsNotDistinctException
 * @throws TooManyEntriesInBatchRequestException
 * @throws BatchRequestTooLongException
 * @throws UnsupportedOperationException
 * @throws InvalidBatchEntryIdException
 * @throws EmptyBatchRequestException
 *
 * @throws AmazonClientException
 *             If any internal errors are encountered inside the client
 *             while attempting to make the request or handle the response.
 *             For example if a network connection is not available.
 * @throws AmazonServiceException
 *             If an error response is returned by AmazonSQS indicating
 *             either a problem with the data in the request, or a server
 *             side issue.
 */
public SendMessageBatchResult sendMessageBatch(String queueUrl, List<SendMessageBatchRequestEntry> entries) {
    SendMessageBatchRequest sendMessageBatchRequest = new SendMessageBatchRequest(queueUrl, entries);
    return sendMessageBatch(sendMessageBatchRequest);
}

From source file:smartthings.brave.sqs.TracingAmazonSQSClient.java

License:Apache License

@Override
public SendMessageBatchResult sendMessageBatch(String queueUrl, List<SendMessageBatchRequestEntry> entries) {
    return this.sendMessageBatch(new SendMessageBatchRequest(queueUrl, entries));
}