Package org.springframework.integration.channel

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


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

        PollableChannel responseChannel = (PollableChannel) 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


        Map<String, Object> headers = new HashMap<String, Object>();
        headers.put(MessageHeaders.RETURN_ADDRESS, responseChannel);
        GenericMessage<String> message = new GenericMessage<String>(MESSAGE_BODY, headers);
        requestChannel.send(message);

        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 {
        PollableChannel channelA = (PollableChannel) 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.