Package com.amazonaws.services.sqs.model

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


            ResultConverter.appendUserAgent(batchRequest, AmazonSQSBufferedAsyncClient.USER_AGENT);

            List<ChangeMessageVisibilityBatchRequestEntry> entries = new ArrayList<ChangeMessageVisibilityBatchRequestEntry>(
                    requests.size());
            for (int i = 0, n = requests.size(); i < n; i++)
                entries.add(new ChangeMessageVisibilityBatchRequestEntry()
                        .withId(Integer.toString(i))
                        .withReceiptHandle(requests.get(i).getReceiptHandle())
                        .withVisibilityTimeout(
                                requests.get(i).getVisibilityTimeout()));
            batchRequest.setEntries(entries);
View Full Code Here


                    new ArrayList<ChangeMessageVisibilityBatchRequestEntry>(messages.size());

                int i = 0;
                for (Message m : messages) {

                    entries.add(new ChangeMessageVisibilityBatchRequestEntry()
                            .withId(Integer.toString(i))
                            .withReceiptHandle(m.getReceiptHandle())
                            .withVisibilityTimeout(0));
                    ++i;
                }
View Full Code Here

                    new ArrayList<ChangeMessageVisibilityBatchRequestEntry>(messages.size());

                int i = 0;
                for (Message m : messages) {
                       
                    entries.add(new ChangeMessageVisibilityBatchRequestEntry()
                            .withId(Integer.toString(i))
                            .withReceiptHandle(m.getReceiptHandle())
                            .withVisibilityTimeout(0));
                    ++i;
                }
View Full Code Here

            ResultConverter.appendUserAgent(batchRequest, AmazonSQSBufferedAsyncClient.USER_AGENT);

            List<ChangeMessageVisibilityBatchRequestEntry> entries = new ArrayList<ChangeMessageVisibilityBatchRequestEntry>(
                    requests.size());
            for (int i = 0, n = requests.size(); i < n; i++)
                entries.add(new ChangeMessageVisibilityBatchRequestEntry()
                        .withId(Integer.toString(i))
                        .withReceiptHandle(requests.get(i).getReceiptHandle())
                        .withVisibilityTimeout(
                                requests.get(i).getVisibilityTimeout()));
            batchRequest.setEntries(entries);
View Full Code Here

                    new ArrayList<ChangeMessageVisibilityBatchRequestEntry>(messages.size());

                int i = 0;
                for (Message m : messages) {
                       
                    entries.add(new ChangeMessageVisibilityBatchRequestEntry()
                            .withId(Integer.toString(i))
                            .withReceiptHandle(m.getReceiptHandle())
                            .withVisibilityTimeout(0));
                    ++i;
                }
View Full Code Here

            ResultConverter.appendUserAgent(batchRequest, AmazonSQSBufferedAsyncClient.USER_AGENT);

            List<ChangeMessageVisibilityBatchRequestEntry> entries = new ArrayList<ChangeMessageVisibilityBatchRequestEntry>(
                    requests.size());
            for (int i = 0, n = requests.size(); i < n; i++)
                entries.add(new ChangeMessageVisibilityBatchRequestEntry()
                        .withId(Integer.toString(i))
                        .withReceiptHandle(requests.get(i).getReceiptHandle())
                        .withVisibilityTimeout(
                                requests.get(i).getVisibilityTimeout()));
            batchRequest.setEntries(entries);
View Full Code Here

                    new ArrayList<ChangeMessageVisibilityBatchRequestEntry>(messages.size());

                int i = 0;
                for (Message m : messages) {
                       
                    entries.add(new ChangeMessageVisibilityBatchRequestEntry()
                            .withId(Integer.toString(i))
                            .withReceiptHandle(m.getReceiptHandle())
                            .withVisibilityTimeout(0));
                    ++i;
                }
View Full Code Here

            ResultConverter.appendUserAgent(batchRequest, AmazonSQSBufferedAsyncClient.USER_AGENT);

            List<ChangeMessageVisibilityBatchRequestEntry> entries = new ArrayList<ChangeMessageVisibilityBatchRequestEntry>(
                    requests.size());
            for (int i = 0, n = requests.size(); i < n; i++)
                entries.add(new ChangeMessageVisibilityBatchRequestEntry()
                        .withId(Integer.toString(i))
                        .withReceiptHandle(requests.get(i).getReceiptHandle())
                        .withVisibilityTimeout(
                                requests.get(i).getVisibilityTimeout()));
            batchRequest.setEntries(entries);
View Full Code Here

        List<ChangeMessageVisibilityBatchRequestEntry> msgList = new ArrayList<ChangeMessageVisibilityBatchRequestEntry>();

        for (Message message : messages) {
            logger.info("MessageId:     " + message.getMessageId());
            logger.info("ReceiptHandle: " + message.getReceiptHandle());
            ChangeMessageVisibilityBatchRequestEntry entry = new ChangeMessageVisibilityBatchRequestEntry("1", message.getReceiptHandle());
            entry.setVisibilityTimeout(60);
            msgList.add(entry);
        }

        logger.info("Change a batch of message visibility timeout with same supplied id");
       
View Full Code Here

                    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>();
            receiveMessageRequest.setMaxNumberOfMessages(10);
            messages = cqs1.receiveMessage(receiveMessageRequest).getMessages();

            assertTrue("Expected 0 messages, received " + messages.size(), messages.size() == 0);
           
            Thread.sleep(11000);

            // check if messages revisible
           
            messages = null;
            receiveMessageRequest.setMaxNumberOfMessages(10);
            receiveMessageRequest.setWaitTimeSeconds(1);
            while (messages == null || messages.size() == 0) {
              logger.info("event=scanning_for_messages");
              messages = cqs1.receiveMessage(receiveMessageRequest).getMessages();
            }

            assertTrue("Expected 5 messages, received " + messages.size(), messages.size() == 5);
           
            // delete messages
           
            List<DeleteMessageBatchRequestEntry> deleteEntryList = new ArrayList<DeleteMessageBatchRequestEntry>();
           
            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++;
               
                deleteEntryList.add(new DeleteMessageBatchRequestEntry(i+"", message.getReceiptHandle()));
View Full Code Here

TOP

Related Classes of com.amazonaws.services.sqs.model.ChangeMessageVisibilityBatchRequestEntry

Copyright © 2018 www.massapicom. 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.