List of usage examples for com.amazonaws.services.sqs.model ChangeMessageVisibilityRequest ChangeMessageVisibilityRequest
public ChangeMessageVisibilityRequest()
From source file:org.duracloud.common.queue.aws.SQSTaskQueue.java
License:Apache License
@Override public void extendVisibilityTimeout(Task task) throws TaskNotFoundException { try {//from w ww.j a v a 2 s .c om sqsClient.changeMessageVisibility(new ChangeMessageVisibilityRequest().withQueueUrl(queueUrl) .withReceiptHandle(task.getProperty(MsgProp.RECEIPT_HANDLE.name())) .withVisibilityTimeout(task.getVisibilityTimeout())); log.info("extended visibility timeout {} seconds for {}", task.getVisibilityTimeout(), task); } catch (ReceiptHandleIsInvalidException rhe) { log.error("failed to extend visibility timeout on task " + task + ": " + rhe.getMessage(), rhe); throw new TaskNotFoundException(rhe); } }
From source file:org.springframework.cloud.aws.messaging.listener.QueueMessageVisibility.java
License:Apache License
@Override public Future<?> extend(int seconds) { return this.amazonSqsAsync.changeMessageVisibilityAsync(new ChangeMessageVisibilityRequest() .withQueueUrl(this.queueUrl).withReceiptHandle(this.receiptHandle).withVisibilityTimeout(seconds)); }