com.amazonaws.services.sqs.model.SendMessageBatchRequestEntry Java Examples

The following examples show how to use com.amazonaws.services.sqs.model.SendMessageBatchRequestEntry. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SnsServiceImpl.java    From Serverless-Programming-Cookbook with MIT License 6 votes vote down vote up
@Override
public final Boolean processEvent(final SNSEvent event, final String outputQueueURL, final LambdaLogger logger) {

    try {

        logger.log("Number of records in event: " + event.getRecords().size());

        Collection<SendMessageBatchRequestEntry> entries = new ArrayList<>();

        int idVal = 1;
        for (SNSRecord r : event.getRecords()) {
            logger.log("Adding message: " + r.getSNS().getMessage());
            entries.add(new SendMessageBatchRequestEntry("id_" + idVal, r.getSNS().getMessage()));
            idVal++;
        }

        final SendMessageBatchRequest sendBatchRequest = new SendMessageBatchRequest()
                .withQueueUrl(outputQueueURL)
                .withEntries(entries);
        this.sqsClient.sendMessageBatch(sendBatchRequest);

    } catch (Exception e) {
        final String errorMessage = "Error occurred: " + e.getMessage();
        logger.log(errorMessage);
        return false;
    }

    return true;

}
 
Example #2
Source File: SendMessageTracingRequestHandler.java    From zipkin-aws with Apache License 2.0 6 votes vote down vote up
private void handleSendMessageBatchRequest(SendMessageBatchRequest request) {
  TraceContext maybeParent = currentTraceContext.get();

  Span span;
  if (maybeParent == null) {
    span = tracer.nextSpan();
  } else {
    // If we have a span in scope assume headers were cleared before
    span = tracer.newChild(maybeParent);
  }

  span.name("publish-batch").remoteServiceName("amazon-sqs").start();
  try (SpanInScope scope = tracer.withSpanInScope(span)) {
    for (SendMessageBatchRequestEntry entry : request.getEntries()) {
      injectPerMessage(request.getQueueUrl(), entry.getMessageAttributes());
    }
  } finally {
    span.finish();
  }
}
 
Example #3
Source File: SqsServiceImpl.java    From Serverless-Programming-Cookbook with MIT License 5 votes vote down vote up
@Override
public final Boolean processEvent(final SQSEvent event, final String outputQueueURL, final LambdaLogger logger) {

    try {

        logger.log("Number of messages in event: " + event.getRecords().size());

        logger.log("Output Queue URL: " + outputQueueURL);

        Collection<SendMessageBatchRequestEntry> entries = new ArrayList<>();

        int idVal = 1;
        for (SQSMessage m : event.getRecords()) {
            logger.log("Adding message: " + m.getBody());
            entries.add(new SendMessageBatchRequestEntry("id_" + idVal, m.getBody()));
            idVal++;
        }

        final SendMessageBatchRequest sendBatchRequest = new SendMessageBatchRequest()
                .withQueueUrl(outputQueueURL)
                .withEntries(entries);
        this.sqsClient.sendMessageBatch(sendBatchRequest);

    } catch (Exception e) {
        final String errorMessage = "Error occurred: " + e.getMessage();
        logger.log(errorMessage);
        return false;
    }

    return true;

}
 
Example #4
Source File: SQSResourcesIntegrationTest.java    From aws-sdk-java-resources with Apache License 2.0 5 votes vote down vote up
/**
 * Tests sending messages using batch operation and retrieve them. Also
 * tests setting the queue attributes and retrieving them.
 */
@Test
@Ignore
public void testQueueSubResourceAndAttributes() throws InterruptedException {

    /**
     * Trying to get the message which is deleted. Here there is no service
     * call made, a new sub resource is created with the given handle. So,
     * this wont be returning null.
     */
    Message message = queue.getMessage("invalid-recepient-handle");
    assertNotNull(message);
    try {
        message.getAttributes();
        fail("An unsupported operation exception must be thrown as load operation is no supported on message attribute");
    } catch (UnsupportedOperationException use) { }

    SendMessageBatchResult sendMessageBatchResult = queue
            .sendMessages(new SendMessageBatchRequest()
                    .withEntries(new SendMessageBatchRequestEntry("msg1",
                            TEST_MESSAGE)));
    SendMessageBatchResultEntry sendMessageBatchResultEntry = sendMessageBatchResult
            .getSuccessful().get(0);
    List<Message> messages = waitForMessagesFromQueue(null);

    assertNotNull(messages);
    assertEquals(1, messages.size());
    message = messages.get(0);
    assertMessage(TEST_MESSAGE, sendMessageBatchResultEntry.getMessageId(),
            sendMessageBatchResultEntry.getMD5OfMessageBody(), message);

    queue.setAttributes(ImmutableMapParameter.of("MaximumMessageSize",
            "2048"));

    assertTrue(queue.getAttributes().containsKey("MaximumMessageSize"));
}
 
Example #5
Source File: SQSObservableQueue.java    From conductor with Apache License 2.0 5 votes vote down vote up
private void publishMessages(List<Message> messages) {
	logger.debug("Sending {} messages to the SQS queue: {}", messages.size(), queueName);
	SendMessageBatchRequest batch = new SendMessageBatchRequest(queueURL);
	messages.forEach(msg -> {
		SendMessageBatchRequestEntry sendr = new SendMessageBatchRequestEntry(msg.getId(), msg.getPayload());
		batch.getEntries().add(sendr);
	});
	logger.debug("sending {} messages in batch", batch.getEntries().size());
	SendMessageBatchResult result = client.sendMessageBatch(batch);
	logger.debug("send result: {} for SQS queue: {}", result.getFailed().toString(), queueName);
}
 
Example #6
Source File: SendMessageTracingRequestHandlerTest.java    From zipkin-aws with Apache License 2.0 5 votes vote down vote up
@Test
public void handleSendMessageBatchRequest() {
  SendMessageBatchRequest request = new SendMessageBatchRequest("queueUrl");
  SendMessageBatchRequestEntry entry1 =
      new SendMessageBatchRequestEntry("id1", "test message body 1");
  SendMessageBatchRequestEntry entry2 =
      new SendMessageBatchRequestEntry("id2", "test message body 2");
  request.withEntries(entry1, entry2);

  handler.beforeExecution(request);

  assertThat(spans).hasSize(3);

  MutableSpan localParent =
      spans.spans().stream().filter(s -> s.parentId() == null).findFirst().get();

  // Verify propagation
  for (SendMessageBatchRequestEntry entry : request.getEntries()) {
    verifyInjectedTraceContext(entry.getMessageAttributes(), localParent);
  }

  // Verify Span
  assertThat(localParent.name()).isEqualTo("publish-batch");

  List<MutableSpan> messageSpans =
      spans.spans().stream().filter(s -> s != localParent).collect(Collectors.toList());
  for (MutableSpan span : messageSpans) {
    verifyReportedPublishSpan(span);
  }
}
 
Example #7
Source File: SendReceiveMessages.java    From aws-doc-sdk-examples with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args)
{
    final AmazonSQS sqs = AmazonSQSClientBuilder.defaultClient();

    try {
        CreateQueueResult create_result = sqs.createQueue(QUEUE_NAME);
    } catch (AmazonSQSException e) {
        if (!e.getErrorCode().equals("QueueAlreadyExists")) {
            throw e;
        }
    }

    String queueUrl = sqs.getQueueUrl(QUEUE_NAME).getQueueUrl();

    SendMessageRequest send_msg_request = new SendMessageRequest()
            .withQueueUrl(queueUrl)
            .withMessageBody("hello world")
            .withDelaySeconds(5);
    sqs.sendMessage(send_msg_request);


    // Send multiple messages to the queue
    SendMessageBatchRequest send_batch_request = new SendMessageBatchRequest()
            .withQueueUrl(queueUrl)
            .withEntries(
                    new SendMessageBatchRequestEntry(
                            "msg_1", "Hello from message 1"),
                    new SendMessageBatchRequestEntry(
                            "msg_2", "Hello from message 2")
                            .withDelaySeconds(10));
    sqs.sendMessageBatch(send_batch_request);

    // receive messages from the queue
    List<Message> messages = sqs.receiveMessage(queueUrl).getMessages();

    // delete messages from the queue
    for (Message m : messages) {
        sqs.deleteMessage(queueUrl, m.getReceiptHandle());
    }
}
 
Example #8
Source File: QueueImpl.java    From aws-sdk-java-resources with Apache License 2.0 5 votes vote down vote up
@Override
public SendMessageBatchResult sendMessages(
        List<SendMessageBatchRequestEntry> entries,
        ResultCapture<SendMessageBatchResult> extractor) {

    SendMessageBatchRequest request = new SendMessageBatchRequest()
        .withEntries(entries);
    return sendMessages(request, extractor);
}
 
Example #9
Source File: QueueImpl.java    From aws-sdk-java-resources with Apache License 2.0 5 votes vote down vote up
@Override
public SendMessageBatchResult sendMessages(
        List<SendMessageBatchRequestEntry> entries) {

    return sendMessages(entries,
            (ResultCapture<SendMessageBatchResult>)null);
}
 
Example #10
Source File: MessageListenerContainerAwsTest.java    From spring-cloud-aws with Apache License 2.0 5 votes vote down vote up
@Override
public void run() {
	List<SendMessageBatchRequestEntry> messages = new ArrayList<>();
	for (int i = 0; i < BATCH_MESSAGE_SIZE; i++) {
		messages.add(new SendMessageBatchRequestEntry(Integer.toString(i),
				new StringBuilder().append("message_").append(i).toString()));
	}
	this.amazonSqs.sendMessageBatch(
			new SendMessageBatchRequest(this.queueUrl, messages));
	this.countDownLatch.countDown();
}
 
Example #11
Source File: AmazonSQSExtendedClient.java    From amazon-sqs-java-extended-client-lib with Apache License 2.0 5 votes vote down vote up
private SendMessageBatchRequestEntry storeMessageInS3(SendMessageBatchRequestEntry batchEntry) {

		checkMessageAttributes(batchEntry.getMessageAttributes());

		String s3Key = UUID.randomUUID().toString();

		// Read the content of the message from message body
		String messageContentStr = batchEntry.getMessageBody();

		Long messageContentSize = getStringSizeInBytes(messageContentStr);

		// Add a new message attribute as a flag
		MessageAttributeValue messageAttributeValue = new MessageAttributeValue();
		messageAttributeValue.setDataType("Number");
		messageAttributeValue.setStringValue(messageContentSize.toString());
		batchEntry.addMessageAttributesEntry(SQSExtendedClientConstants.RESERVED_ATTRIBUTE_NAME, messageAttributeValue);

		// Store the message content in S3.
		storeTextInS3(s3Key, messageContentStr, messageContentSize);

		LOG.info("S3 object created, Bucket name: " + clientConfiguration.getS3BucketName() + ", Object key: " + s3Key
				+ ".");

		// Convert S3 pointer (bucket name, key, etc) to JSON string
		MessageS3Pointer s3Pointer = new MessageS3Pointer(clientConfiguration.getS3BucketName(), s3Key);
		String s3PointerStr = getJSONFromS3Pointer(s3Pointer);

		// Storing S3 pointer in the message body.
		batchEntry.setMessageBody(s3PointerStr);

		return batchEntry;
	}
 
Example #12
Source File: PutSQS.java    From nifi with Apache License 2.0 4 votes vote down vote up
@Override
public void onTrigger(final ProcessContext context, final ProcessSession session) {
    FlowFile flowFile = session.get();
    if (flowFile == null) {
        return;
    }

    final long startNanos = System.nanoTime();
    final AmazonSQSClient client = getClient();
    final SendMessageBatchRequest request = new SendMessageBatchRequest();
    final String queueUrl = context.getProperty(QUEUE_URL).evaluateAttributeExpressions(flowFile).getValue();
    request.setQueueUrl(queueUrl);

    final Set<SendMessageBatchRequestEntry> entries = new HashSet<>();

    final SendMessageBatchRequestEntry entry = new SendMessageBatchRequestEntry();
    entry.setId(flowFile.getAttribute("uuid"));
    final ByteArrayOutputStream baos = new ByteArrayOutputStream();
    session.exportTo(flowFile, baos);
    final String flowFileContent = baos.toString();
    entry.setMessageBody(flowFileContent);

    final Map<String, MessageAttributeValue> messageAttributes = new HashMap<>();

    for (final PropertyDescriptor descriptor : userDefinedProperties) {
        final MessageAttributeValue mav = new MessageAttributeValue();
        mav.setDataType("String");
        mav.setStringValue(context.getProperty(descriptor).evaluateAttributeExpressions(flowFile).getValue());
        messageAttributes.put(descriptor.getName(), mav);
    }

    entry.setMessageAttributes(messageAttributes);
    entry.setDelaySeconds(context.getProperty(DELAY).asTimePeriod(TimeUnit.SECONDS).intValue());
    entries.add(entry);

    request.setEntries(entries);

    try {
        SendMessageBatchResult response = client.sendMessageBatch(request);

        // check for errors
        if (!response.getFailed().isEmpty()) {
            throw new ProcessException(response.getFailed().get(0).toString());
        }
    } catch (final Exception e) {
        getLogger().error("Failed to send messages to Amazon SQS due to {}; routing to failure", new Object[]{e});
        flowFile = session.penalize(flowFile);
        session.transfer(flowFile, REL_FAILURE);
        return;
    }

    getLogger().info("Successfully published message to Amazon SQS for {}", new Object[]{flowFile});
    session.transfer(flowFile, REL_SUCCESS);
    final long transmissionMillis = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startNanos);
    session.getProvenanceReporter().send(flowFile, queueUrl, transmissionMillis);
}
 
Example #13
Source File: AmazonSQSExtendedClient.java    From amazon-sqs-java-extended-client-lib with Apache License 2.0 4 votes vote down vote up
private boolean isLarge(SendMessageBatchRequestEntry batchEntry) {
	int msgAttributesSize = getMsgAttributesSize(batchEntry.getMessageAttributes());
	long msgBodySize = getStringSizeInBytes(batchEntry.getMessageBody());
	long totalMsgSize = msgAttributesSize + msgBodySize;
	return (totalMsgSize > clientConfiguration.getMessageSizeThreshold());
}
 
Example #14
Source File: PutSQS.java    From localization_nifi with Apache License 2.0 4 votes vote down vote up
@Override
public void onTrigger(final ProcessContext context, final ProcessSession session) {
    FlowFile flowFile = session.get();
    if (flowFile == null) {
        return;
    }

    final long startNanos = System.nanoTime();
    final AmazonSQSClient client = getClient();
    final SendMessageBatchRequest request = new SendMessageBatchRequest();
    final String queueUrl = context.getProperty(QUEUE_URL).evaluateAttributeExpressions(flowFile).getValue();
    request.setQueueUrl(queueUrl);

    final Set<SendMessageBatchRequestEntry> entries = new HashSet<>();

    final SendMessageBatchRequestEntry entry = new SendMessageBatchRequestEntry();
    entry.setId(flowFile.getAttribute("uuid"));
    final ByteArrayOutputStream baos = new ByteArrayOutputStream();
    session.exportTo(flowFile, baos);
    final String flowFileContent = baos.toString();
    entry.setMessageBody(flowFileContent);

    final Map<String, MessageAttributeValue> messageAttributes = new HashMap<>();

    for (final PropertyDescriptor descriptor : userDefinedProperties) {
        final MessageAttributeValue mav = new MessageAttributeValue();
        mav.setDataType("String");
        mav.setStringValue(context.getProperty(descriptor).evaluateAttributeExpressions(flowFile).getValue());
        messageAttributes.put(descriptor.getName(), mav);
    }

    entry.setMessageAttributes(messageAttributes);
    entry.setDelaySeconds(context.getProperty(DELAY).asTimePeriod(TimeUnit.SECONDS).intValue());
    entries.add(entry);

    request.setEntries(entries);

    try {
        client.sendMessageBatch(request);
    } catch (final Exception e) {
        getLogger().error("Failed to send messages to Amazon SQS due to {}; routing to failure", new Object[]{e});
        flowFile = session.penalize(flowFile);
        session.transfer(flowFile, REL_FAILURE);
        return;
    }

    getLogger().info("Successfully published message to Amazon SQS for {}", new Object[]{flowFile});
    session.transfer(flowFile, REL_SUCCESS);
    final long transmissionMillis = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startNanos);
    session.getProvenanceReporter().send(flowFile, queueUrl, transmissionMillis);
}
 
Example #15
Source File: MessageContent.java    From amazon-sqs-java-temporary-queues-client with Apache License 2.0 4 votes vote down vote up
public SendMessageBatchRequestEntry toSendMessageBatchRequestEntry() {
    return new SendMessageBatchRequestEntry().withMessageBody(messageBody).withMessageAttributes(new HashMap<>(messageAttributes));
}
 
Example #16
Source File: AmazonSQSExtendedClient.java    From amazon-sqs-java-extended-client-lib with Apache License 2.0 3 votes vote down vote up
/**
 * <p>
 * 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>
 * <b>IMPORTANT:</b> The input object may be modified by the method. </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 sendMessageBatchRequest
 *            Container for the necessary parameters to execute the
 *            SendMessageBatch service method on AmazonSQS.
 *
 * @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(SendMessageBatchRequest sendMessageBatchRequest) {

	if (sendMessageBatchRequest == null) {
		String errorMessage = "sendMessageBatchRequest cannot be null.";
		LOG.error(errorMessage);
		throw new AmazonClientException(errorMessage);
	}

	sendMessageBatchRequest.getRequestClientOptions().appendUserAgent(SQSExtendedClientConstants.USER_AGENT_HEADER);

	if (!clientConfiguration.isLargePayloadSupportEnabled()) {
		return super.sendMessageBatch(sendMessageBatchRequest);
	}

	List<SendMessageBatchRequestEntry> batchEntries = sendMessageBatchRequest.getEntries();

	int index = 0;
	for (SendMessageBatchRequestEntry entry : batchEntries) {
		if (clientConfiguration.isAlwaysThroughS3() || isLarge(entry)) {
			batchEntries.set(index, storeMessageInS3(entry));
		}
		++index;
	}

	return super.sendMessageBatch(sendMessageBatchRequest);
}
 
Example #17
Source File: AmazonSQSExtendedClient.java    From amazon-sqs-java-extended-client-lib with Apache License 2.0 2 votes vote down vote up
/**
 * <p>
 * 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);
}
 
Example #18
Source File: AmazonSQSExtendedClientBase.java    From amazon-sqs-java-extended-client-lib with Apache License 2.0 2 votes vote down vote up
/**
 * <p>
 * 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. The maximum allowed individual
 * message size is 256 KB (262,144 bytes).
 * </p>
 * <p>
 * The maximum total payload size (i.e., the sum of all a batch's individual
 * message lengths) is also 256 KB (262,144 bytes).
 * </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)
		throws AmazonServiceException, AmazonClientException {

	return amazonSqsToBeExtended.sendMessageBatch(queueUrl, entries);
}
 
Example #19
Source File: Queue.java    From aws-sdk-java-resources with Apache License 2.0 2 votes vote down vote up
/**
 * The convenient method form for the <code>SendMessages</code> action.
 *
 * @see #sendMessages(SendMessageBatchRequest)
 */
SendMessageBatchResult sendMessages(List<SendMessageBatchRequestEntry>
        entries);
 
Example #20
Source File: Queue.java    From aws-sdk-java-resources with Apache License 2.0 2 votes vote down vote up
/**
 * The convenient method form for the <code>SendMessages</code> action.
 *
 * @see #sendMessages(SendMessageBatchRequest, ResultCapture)
 */
SendMessageBatchResult sendMessages(List<SendMessageBatchRequestEntry>
        entries, ResultCapture<SendMessageBatchResult> extractor);