Package org.springframework.integration.channel

Examples of org.springframework.integration.channel.MessageChannel.receive()


        Message message = new StringMessage(MESSAGE_BODY);
        message.getHeader().setReturnAddress("responseChannel");
        requestChannel.send(message);

        MessageChannel responseChannel = (MessageChannel) applicationContext.getBean("responseChannel");
        Message responseMessage = responseChannel.receive();
        String result = (String) responseMessage.getPayload();

        assertEquals("Get the wrong result", MESSAGE_BODY + " is processed",  result);
    }
View Full Code Here


        MessageChannel requestChannel = (MessageChannel) applicationContext.getBean("channelB");
        Message message = new StringMessage(MESSAGE_BODY);
        requestChannel.send(message);

        MessageChannel responseChannel = (MessageChannel) applicationContext.getBean("channelC");
        Message responseMessage = responseChannel.receive();
        String result = (String) responseMessage.getPayload();

        assertEquals("Get the wrong result", MESSAGE_BODY + " is processed",  result);
    }
View Full Code Here

public class CamelSourceAdapterTest extends SpringTestSupport {
    public void testSendingOneWayMessage() throws Exception {
        MessageChannel channelA = (MessageChannel) applicationContext.getBean("channelA");
        template.sendBody("direct:OneWay", "Willem");
        Message message = channelA.receive();
        assertEquals("We should get the message from channelA", message.getPayload(), "Willem");

    }

    public void testSendingTwoWayMessage() throws Exception {
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.