@Override public ChangeMessageVisibilityBatchResult changeMessageVisibilityBatch(ChangeMessageVisibilityBatchRequest changeMessageVisibilityBatchRequest) throws AmazonClientException { DirectorySQSQueue queue = getQueueFromUrl(changeMessageVisibilityBatchRequest.getQueueUrl(), false); //lists for reporting List<BatchResultErrorEntry> batchResultErrorEntries = new ArrayList<>(); List<ChangeMessageVisibilityBatchResultEntry> batchResultEntries = new ArrayList<>(); //attempt to change the visibility on each for (ChangeMessageVisibilityBatchRequestEntry batchRequestEntry : changeMessageVisibilityBatchRequest.getEntries()) { try { queue.changeVisibility(batchRequestEntry.getReceiptHandle(), batchRequestEntry.getVisibilityTimeout()); batchResultEntries.add(new ChangeMessageVisibilityBatchResultEntry().withId(batchRequestEntry.getId())); } catch (Exception e) { BatchResultErrorEntry batchResultErrorEntry = new BatchResultErrorEntry(). withSenderFault(true). withId(batchRequestEntry.getId()). withMessage(e.getMessage()); batchResultErrorEntries.add(batchResultErrorEntry); } } return new ChangeMessageVisibilityBatchResult().withFailed(batchResultErrorEntries).withSuccessful(batchResultEntries); }
/** * Simplified method form for invoking the ChangeMessageVisibilityBatch * operation. * * @see #changeMessageVisibilityBatch(ChangeMessageVisibilityBatchRequest) */ public ChangeMessageVisibilityBatchResult changeMessageVisibilityBatch( String queueUrl, java.util.List<ChangeMessageVisibilityBatchRequestEntry> entries) { ChangeMessageVisibilityBatchRequest changeMessageVisibilityBatchRequest = new ChangeMessageVisibilityBatchRequest(queueUrl, entries); return changeMessageVisibilityBatch(changeMessageVisibilityBatchRequest); }
@Override public ChangeMessageVisibilityBatchResult changeMessageVisibilityBatch( ChangeMessageVisibilityBatchRequest request, ResultCapture<ChangeMessageVisibilityBatchResult> extractor) { ActionResult result = resource.performAction("ChangeMessageVisibilityBatch", request, extractor); if (result == null) return null; return (ChangeMessageVisibilityBatchResult) result.getData(); }
@Override public ChangeMessageVisibilityBatchResult changeMessageVisibilityBatch( List<ChangeMessageVisibilityBatchRequestEntry> entries) { return changeMessageVisibilityBatch(entries, (ResultCapture<ChangeMessageVisibilityBatchResult>)null); }
@Override public ChangeMessageVisibilityBatchResult changeMessageVisibilityBatch( List<ChangeMessageVisibilityBatchRequestEntry> entries, ResultCapture<ChangeMessageVisibilityBatchResult> extractor) { ChangeMessageVisibilityBatchRequest request = new ChangeMessageVisibilityBatchRequest() .withEntries(entries); return changeMessageVisibilityBatch(request, extractor); }
public Observable<ChangeMessageVisibilityBatchResult> changeMessageVisibilityBatchAsync(ChangeMessageVisibilityBatchRequest request) { return Observable.from(sqsClient.changeMessageVisibilityBatchAsync(request)); }
public Observable<ChangeMessageVisibilityBatchResult> changeMessageVisibilityBatchAsync(String queueUrl, List<ChangeMessageVisibilityBatchRequestEntry> entries) { return Observable.from(sqsClient.changeMessageVisibilityBatchAsync(queueUrl, entries)); }
@Override public ChangeMessageVisibilityBatchResult changeMessageVisibilityBatch( ChangeMessageVisibilityBatchRequest request) { return changeMessageVisibilityBatch(request, null); }
/** * <p> * Changes the visibility timeout of multiple messages. This is a batch * version of ChangeMessageVisibility. The result of the action on each * message is reported individually in the response. You can send up to 10 * ChangeMessageVisibility requests with each * <code>ChangeMessageVisibilityBatch</code> action. * </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 changeMessageVisibilityBatchRequest * Container for the necessary parameters to execute the * ChangeMessageVisibilityBatch service method on AmazonSQS. * * @return The response from the ChangeMessageVisibilityBatch service * method, as returned by AmazonSQS. * * @throws BatchEntryIdsNotDistinctException * @throws TooManyEntriesInBatchRequestException * @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 ChangeMessageVisibilityBatchResult changeMessageVisibilityBatch( ChangeMessageVisibilityBatchRequest changeMessageVisibilityBatchRequest) throws AmazonServiceException, AmazonClientException { return amazonSqsToBeExtended.changeMessageVisibilityBatch(changeMessageVisibilityBatchRequest); }
/** * <p> * Changes the visibility timeout of multiple messages. This is a batch * version of ChangeMessageVisibility. The result of the action on each * message is reported individually in the response. You can send up to 10 * ChangeMessageVisibility requests with each * <code>ChangeMessageVisibilityBatch</code> action. * </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 receipt handles of the messages for which the * visibility timeout must be changed. * * @return The response from the ChangeMessageVisibilityBatch service * method, as returned by AmazonSQS. * * @throws BatchEntryIdsNotDistinctException * @throws TooManyEntriesInBatchRequestException * @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 ChangeMessageVisibilityBatchResult changeMessageVisibilityBatch(String queueUrl, List<ChangeMessageVisibilityBatchRequestEntry> entries) throws AmazonServiceException, AmazonClientException { return amazonSqsToBeExtended.changeMessageVisibilityBatch(queueUrl, entries); }
/** * <p> * Changes the visibility timeout of multiple messages. This is a batch * version of ChangeMessageVisibility. The result of the action on each * message is reported individually in the response. You can send up to 10 * ChangeMessageVisibility requests with each * <code>ChangeMessageVisibilityBatch</code> action. * </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 changeMessageVisibilityBatchRequest * Container for the necessary parameters to execute the * ChangeMessageVisibilityBatch service method on AmazonSQS. * * @return The response from the ChangeMessageVisibilityBatch service * method, as returned by AmazonSQS. * * @throws BatchEntryIdsNotDistinctException * @throws TooManyEntriesInBatchRequestException * @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 ChangeMessageVisibilityBatchResult changeMessageVisibilityBatch( ChangeMessageVisibilityBatchRequest changeMessageVisibilityBatchRequest) throws AmazonServiceException, AmazonClientException { for (ChangeMessageVisibilityBatchRequestEntry entry : changeMessageVisibilityBatchRequest.getEntries()) { if (isS3ReceiptHandle(entry.getReceiptHandle())) { entry.setReceiptHandle(getOrigReceiptHandle(entry.getReceiptHandle())); } } return amazonSqsToBeExtended.changeMessageVisibilityBatch(changeMessageVisibilityBatchRequest); }
/** * Calls <code>changeMessageVisibilityBatch</code> and wraps <code>AmazonClientException</code>. This is * used to for negative acknowledge of messages in batch, so that messages * can be received again without any delay. * * @param changeMessageVisibilityBatchRequest * Container for the necessary parameters to execute the * changeMessageVisibilityBatch service method on AmazonSQS. * @return The response from the changeMessageVisibilityBatch service * method, as returned by AmazonSQS. * @throws JMSException */ public ChangeMessageVisibilityBatchResult changeMessageVisibilityBatch(ChangeMessageVisibilityBatchRequest changeMessageVisibilityBatchRequest) throws JMSException { try { prepareRequest(changeMessageVisibilityBatchRequest); return amazonSQSClient.changeMessageVisibilityBatch(changeMessageVisibilityBatchRequest); } catch (AmazonClientException e) { throw handleException(e, "changeMessageVisibilityBatch"); } }
/** * Performs the <code>ChangeMessageVisibilityBatch</code> action. * * <p> * The following request parameters will be populated from the data of this * <code>Queue</code> resource, and any conflicting parameter value set in * the request will be overridden: * <ul> * <li> * <b><code>QueueUrl</code></b> * - mapped from the <code>Url</code> identifier. * </li> * </ul> * * <p> * * @return The response of the low-level client operation associated with * this resource action. * @see ChangeMessageVisibilityBatchRequest */ ChangeMessageVisibilityBatchResult changeMessageVisibilityBatch( ChangeMessageVisibilityBatchRequest request);
/** * Performs the <code>ChangeMessageVisibilityBatch</code> action and use a * ResultCapture to retrieve the low-level client response. * * <p> * The following request parameters will be populated from the data of this * <code>Queue</code> resource, and any conflicting parameter value set in * the request will be overridden: * <ul> * <li> * <b><code>QueueUrl</code></b> * - mapped from the <code>Url</code> identifier. * </li> * </ul> * * <p> * * @return The response of the low-level client operation associated with * this resource action. * @see ChangeMessageVisibilityBatchRequest */ ChangeMessageVisibilityBatchResult changeMessageVisibilityBatch( ChangeMessageVisibilityBatchRequest request, ResultCapture<ChangeMessageVisibilityBatchResult> extractor);
/** * The convenient method form for the * <code>ChangeMessageVisibilityBatch</code> action. * * @see #changeMessageVisibilityBatch(ChangeMessageVisibilityBatchRequest) */ ChangeMessageVisibilityBatchResult changeMessageVisibilityBatch( List<ChangeMessageVisibilityBatchRequestEntry> entries);
/** * The convenient method form for the * <code>ChangeMessageVisibilityBatch</code> action. * * @see #changeMessageVisibilityBatch(ChangeMessageVisibilityBatchRequest, * ResultCapture) */ ChangeMessageVisibilityBatchResult changeMessageVisibilityBatch( List<ChangeMessageVisibilityBatchRequestEntry> entries, ResultCapture<ChangeMessageVisibilityBatchResult> extractor);