Package com.rabbitmq.messagepatterns.unicast

Examples of com.rabbitmq.messagepatterns.unicast.ReceivedMessage


      }
    };
  }
 
  protected void assertMessageReceived(String msg) throws Exception {
      ReceivedMessage message = receiver.receive(1000);
      assertEquals(msg, new String(message.getBody()));
  }
View Full Code Here


        }
    }

    private void readFromQueue() throws Exception {
        while (executor != null && !executor.isShutdown()) {
            ReceivedMessage message = receiver.receive();
            if(message != null) {
                LOG.debug("Recieved message from queue {}", queueName);

                Exchange exchange = getEndpoint().createExchange();

                Message msg = new DefaultMessage();
                msg.setBody(message.getBody());
                exchange.setIn(msg);
                getProcessor().process(exchange);
                receiver.ack(message);
            }
        }
View Full Code Here

    public void senderSendsMessagesAndReceiverReceivesThem() throws Exception {
        Message msg = sender.createMessage();
        msg.setBody(MESSAGE_BODY.getBytes());
        sender.send(msg);
       
        ReceivedMessage msg2 = receiver.receive(1000);
        receiver.ack(msg2);
        assertEquals(MESSAGE_BODY, new String(msg2.getBody()));
       
        sender.stop();
        receiver.stop();
    }
View Full Code Here

TOP

Related Classes of com.rabbitmq.messagepatterns.unicast.ReceivedMessage

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.