Package com.amazonaws.services.sqs.model

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


        // SendMessage
          if (request.getOriginalRequest() instanceof SendMessageRequest
              && response instanceof SendMessageResult) {
            if (log.isDebugEnabled())
              log.debug("Checking the MD5 digest returned in SendMessageResult.");
            SendMessageRequest sendMessageRequest = (SendMessageRequest)request.getOriginalRequest();
            SendMessageResult sendMessageResult = (SendMessageResult)response;
            String messageSent = sendMessageRequest.getMessageBody();
            String md5Returned = sendMessageResult.getMD5OfMessageBody();
            if ( !checkMessageMd5(messageSent, md5Returned) )
              throw new AmazonClientException("MD5 returned by SQS does not match the calculation on the original request.(Message body: \""
                  + messageSent + "\", MD5 returned: \"" + md5Returned + "\")");
          }
View Full Code Here


        super(endpoint);
    }

    public void process(Exchange exchange) throws Exception {
        String body = exchange.getIn().getBody(String.class);
        SendMessageRequest request = new SendMessageRequest(getQueueUrl(), body);
        addDelay(request, exchange);

        LOG.trace("Sending request [{}] from exchange [{}]...", request, exchange);
       
        SendMessageResult result = getClient().sendMessage(request);
View Full Code Here

        super(endpoint);
    }

    public void process(Exchange exchange) throws Exception {
        String body = exchange.getIn().getBody(String.class);
        SendMessageRequest request = new SendMessageRequest(getQueueUrl(), body);
        request.setMessageAttributes(translateAttributes(exchange.getIn().getHeaders(), exchange));
        addDelay(request, exchange);

        LOG.trace("Sending request [{}] from exchange [{}]...", request, exchange);
       
        SendMessageResult result = getClient().sendMessage(request);
View Full Code Here

            }
            System.out.println();

            // Send a message
            System.out.println("Sending a message to MyQueue.\n");
            sqs.sendMessage(new SendMessageRequest(myQueueUrl, "This is my message text."));

            // Receive messages
            System.out.println("Receiving messages from MyQueue.\n");
            ReceiveMessageRequest receiveMessageRequest = new ReceiveMessageRequest(myQueueUrl);
            List<Message> messages = sqs.receiveMessage(receiveMessageRequest).getMessages();
View Full Code Here

    }

    @Override
    public SendMessageResult sendMessage(String queueUrl, String messageBody)
            throws AmazonServiceException, AmazonClientException {
        return sendMessage(new SendMessageRequest(queueUrl, messageBody));
    }
View Full Code Here

    public void afterResponse(Request<?> request, Object response, TimingInfo timingInfo) {
        if ( request  != null && response != null ) {
            // SendMessage
            if (request.getOriginalRequest() instanceof SendMessageRequest
                    && response instanceof SendMessageResult) {
                SendMessageRequest sendMessageRequest = (SendMessageRequest)request.getOriginalRequest();
                SendMessageResult sendMessageResult = (SendMessageResult)response;
                sendMessageOperationMd5Check(sendMessageRequest, sendMessageResult);
            }

            // ReceiveMessage
View Full Code Here

    protected boolean resign(SQSResignerModel model) {
        boolean success = false;
        if (model != null) {
            String json = JsonUtil.marshall(model);
            if (StringUtils.hasText(json)) {
                SendMessageRequest request = new SendMessageRequest(resignQueueUrl, json);
                try {
                    SendMessageResult result = sqsClient.sendMessage(request);
                    if (result != null) {
                        success = true;
                    }
View Full Code Here

   */
  public Object executeOutboundOperation(final Message<?> message) {

    MessagePacket packet = new MessagePacket(message);
    if (queue == null) {
      SendMessageRequest request = new SendMessageRequest(queueUrl,
          packet.toJSON());
      SendMessageResult result = sqsClient.sendMessage(request);
      log.debug("Message sent, Id:" + result.getMessageId());
    } else {
      queue.add(packet.toJSON());
View Full Code Here

        super(endpoint);
    }

    public void process(Exchange exchange) throws Exception {
        String body = exchange.getIn().getBody(String.class);
        SendMessageRequest request = new SendMessageRequest(getQueueUrl(), body);
        addDelay(request, exchange);

        LOG.trace("Sending request [{}] from exchange [{}]...", request, exchange);
       
        SendMessageResult result = getClient().sendMessage(request);
View Full Code Here

        // nothing
    }

    @Override
    public void logTask(QSLogTickModel logTick) {
        sqs.sendMessage(new SendMessageRequest(queueUrl, thing(logTick)));
    }
View Full Code Here

TOP

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

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.