Package com.amazonaws.services.sqs.model

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


        }

        logger.info("Receive messages with invalid max number of messages");
       
        try {
            ReceiveMessageRequest receiveMessageRequest = new ReceiveMessageRequest(queueUrl);
            receiveMessageRequest.setVisibilityTimeout(10);
            receiveMessageRequest.setMaxNumberOfMessages(12);
            cqs1.receiveMessage(receiveMessageRequest).getMessages();
          fail("missing expected exception");
        } catch (AmazonServiceException ase) {
            assertTrue("Did not get an invalid value exception", ase.getErrorCode().contains(CQSErrorCodes.InvalidParameterValue.getCMBCode()));
        }

        logger.info("Receive messages with invalid max number of messages");
       
        try {
            ReceiveMessageRequest receiveMessageRequest = new ReceiveMessageRequest(queueUrl);
            receiveMessageRequest.setVisibilityTimeout(10);
            receiveMessageRequest.setMaxNumberOfMessages(0);
            cqs1.receiveMessage(receiveMessageRequest).getMessages();
          fail("missing expected exception");
        } catch (AmazonServiceException ase) {
            assertTrue("Did not get an invalid value exception", ase.getErrorCode().contains(CQSErrorCodes.InvalidParameterValue.getCMBCode()));
        }
View Full Code Here


            fail(ase.toString());
        }
       
        logger.info("Receiving messages from " + queueUrl);
       
        ReceiveMessageRequest receiveMessageRequest = new ReceiveMessageRequest(queueUrl);

        List<Message> messages = new ArrayList<Message>();
        receiveMessageRequest.setVisibilityTimeout(60);
        receiveMessageRequest.setMaxNumberOfMessages(6);
        messages = cqs1.receiveMessage(receiveMessageRequest).getMessages();
       
        assertTrue("Did not receive any messages", messages.size() > 0);
       
        List<DeleteMessageBatchRequestEntry> deleteMsgList = new ArrayList<DeleteMessageBatchRequestEntry>();
View Full Code Here

          fail("exception where none expected");
        }

        logger.info("Receiving messages from " + queueUrl);
       
        ReceiveMessageRequest receiveMessageRequest = new ReceiveMessageRequest(queueUrl);

        List<Message> messages = new ArrayList<Message>();
        receiveMessageRequest.setVisibilityTimeout(60);
        receiveMessageRequest.setMaxNumberOfMessages(6);
        messages = cqs1.receiveMessage(receiveMessageRequest).getMessages();
       
        List<ChangeMessageVisibilityBatchRequestEntry> msgList = new ArrayList<ChangeMessageVisibilityBatchRequestEntry>();

        for (Message message : messages) {
View Full Code Here

          cqs1.sendMessage(new SendMessageRequest(queueUrl1, "This is my message text 2. " + (new Random()).nextInt()));
          cqs1.sendMessage(new SendMessageRequest(queueUrl1, "This is my message text 3. " + (new Random()).nextInt()));
  
          logger.info("Receiving messages from " + queueUrl1);
         
          ReceiveMessageRequest receiveMessageRequest = new ReceiveMessageRequest(queueUrl1);
 
          List<Message> messages = new ArrayList<Message>();
          receiveMessageRequest.setVisibilityTimeout(600);
 
          receiveMessageRequest.setMaxNumberOfMessages(2);
          messages = cqs1.receiveMessage(receiveMessageRequest).getMessages();
          assertTrue("Expected 2 messages, instead found " + messages.size(), messages.size() == 2);
 
          for (Message message : messages) {
           
View Full Code Here

           
            // receive message
           
            logger.info("Receiving messages from " + queueUrl);
           
            ReceiveMessageRequest receiveMessageRequest = new ReceiveMessageRequest(queueUrl);

            List<Message> messages = new ArrayList<Message>();
            receiveMessageRequest.setVisibilityTimeout(60);
            receiveMessageRequest.setMaxNumberOfMessages(10);
            messages = cqs1.receiveMessage(receiveMessageRequest).getMessages();

            assertTrue("Expected 1 message, instead found " + messages.size(), messages.size() == 1);

            String receiptHandle = null;
View Full Code Here

           
            // receive message
           
            logger.info("Receiving messages from " + queueUrl);
           
            ReceiveMessageRequest receiveMessageRequest = new ReceiveMessageRequest(queueUrl);
            int timeoutSeconds = 40;

            List<Message> messages = new ArrayList<Message>();
            receiveMessageRequest.setVisibilityTimeout(timeoutSeconds);
            receiveMessageRequest.setMaxNumberOfMessages(10);
            receiveMessageRequest.setWaitTimeSeconds(2);
            messages = cqs1.receiveMessage(receiveMessageRequest).getMessages();

            assertTrue("Expected 1 message, instead found " + messages.size(), messages.size() == 1);

            for (Message message : messages) {
View Full Code Here

        try {
         
            final String queueUrl = getQueueUrl(1, USR.USER1);
            Thread.sleep(1000);
           
        final ReceiveMessageRequest receiveMessageRequest = new ReceiveMessageRequest(queueUrl);
            receiveMessageRequest.setVisibilityTimeout(120);
            receiveMessageRequest.setMaxNumberOfMessages(10);
            receiveMessageRequest.setWaitTimeSeconds(20);

            (new Thread() {
              public void run() {
                long ts1 = System.currentTimeMillis();
                logger.info("event=lp_receive vto=120 wt=20");
View Full Code Here

            // receive messages
           
            logger.info("Receiving messages from " + queueUrl);

            ReceiveMessageRequest receiveMessageRequest = new ReceiveMessageRequest(queueUrl);

            List<Message> messages = new ArrayList<Message>();
            receiveMessageRequest.setVisibilityTimeout(60);
            receiveMessageRequest.setMaxNumberOfMessages(1);
            messages = cqs1.receiveMessage(receiveMessageRequest).getMessages();
           
            assertTrue("Expected one message, instead got " + messages.size(), messages.size() == 1);

            for (Message message : messages) {
View Full Code Here

            // receive messages
           
            logger.info("Receiving messages from " + queueUrl);

            ReceiveMessageRequest receiveMessageRequest = new ReceiveMessageRequest(queueUrl);

            List<Message> messages = new ArrayList<Message>();
            receiveMessageRequest.setVisibilityTimeout(60);
            receiveMessageRequest.setMaxNumberOfMessages(10);
            messages = cqs1.receiveMessage(receiveMessageRequest).getMessages();
           
            assertTrue("Expected one message, instead got " + messages.size(), messages.size() == 1);

            for (Message message : messages) {
View Full Code Here

            // receive messages
           
            logger.info("Receiving messages from " + queueUrl);
           
            ReceiveMessageRequest receiveMessageRequest = new ReceiveMessageRequest(queueUrl);

            List<Message> messages = new ArrayList<Message>();
            receiveMessageRequest.setVisibilityTimeout(60);
            receiveMessageRequest.setMaxNumberOfMessages(10);
            messages = cqs1.receiveMessage(receiveMessageRequest).getMessages();

            assertTrue("Expected 5 messages, instead found " + messages.size(), messages.size() == 5);

            List<DeleteMessageBatchRequestEntry> deleteEntryList = new ArrayList<DeleteMessageBatchRequestEntry>();
View Full Code Here

TOP

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

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.