Examples of ChangeMessageVisibilityBatchRequest


Examples of com.amazonaws.services.sqs.model.ChangeMessageVisibilityBatchRequest

            // change message visibility batch to 10 sec for all messages

            int i = 0;
           
            ChangeMessageVisibilityBatchRequest changeMessageVisibilityBatchRequest = new ChangeMessageVisibilityBatchRequest();
            changeMessageVisibilityBatchRequest.setQueueUrl(queueUrl);
           
            List<ChangeMessageVisibilityBatchRequestEntry> visibilityEntryList = new ArrayList<ChangeMessageVisibilityBatchRequestEntry>();
           
            for (Message message : messages) {
             
                logger.info("  Message");
                logger.info("    MessageId:     " + message.getMessageId());
                logger.info("    ReceiptHandle: " + message.getReceiptHandle());
                logger.info("    MD5OfBody:     " + message.getMD5OfBody());
                logger.info("    Body:          " + message.getBody());
               
                for (Entry<String, String> entry : message.getAttributes().entrySet()) {
                    logger.info("  Attribute");
                    logger.info("    Name:  " + entry.getKey());
                    logger.info("    Value: " + entry.getValue());
                }
               
                i++;
               
                ChangeMessageVisibilityBatchRequestEntry entry = new ChangeMessageVisibilityBatchRequestEntry(i + "", message.getReceiptHandle());
                entry.setVisibilityTimeout(10);
                visibilityEntryList.add(entry);
            }
           
            changeMessageVisibilityBatchRequest.setEntries(visibilityEntryList);
            cqs1.changeMessageVisibilityBatch(changeMessageVisibilityBatchRequest);
           
            // check if messages invisible
           
            messages = new ArrayList<Message>();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.