Package org.springframework.integration

Examples of org.springframework.integration.MessageChannel.send()


            //Check the message header for the return address
            response = SpringIntegrationBinding.storeToSpringIntegrationMessage(outExchange.getOut());
            if (replyChannel == null) {
                MessageChannel messageReplyChannel = (MessageChannel) message.getHeaders().get(MessageHeaders.REPLY_CHANNEL);
                if (messageReplyChannel != null) {
                    result = messageReplyChannel.send(response);
                } else {
                    throw new MessageDeliveryException(response, "Cannot resolve ReplyChannel from message: " + message);
                }
            } else {
                result = replyChannel.send(response);
View Full Code Here


            org.springframework.integration.Message<?> siOutMessage =
                SpringIntegrationBinding.storeToSpringIntegrationMessage(exchange.getOut());

            // send the message to spring integration
            log.debug("Sending {} to ReplyChannel: {}", siOutMessage, reply);
            reply.send(siOutMessage);
        }       
    }  

}
View Full Code Here

                assertEquals("Get the wrong result", MESSAGE_BODY + " is processed",  message.getPayload());
                assertEquals("Done",  message.getHeaders().get("Status"));
            }            
        });

        requestChannel.send(message);

        assertTrue(latch.await(1, TimeUnit.SECONDS));
    }

    public ClassPathXmlApplicationContext createApplicationContext() {
View Full Code Here

    public void testSendingOneWayMessage() throws Exception {
        MockEndpoint resultEndpoint = getMockEndpoint("mock:result");
        resultEndpoint.expectedBodiesReceived(MESSAGE_BODY);

        MessageChannel outputChannel = getMandatoryBean(MessageChannel.class, "channelA");
        outputChannel.send(new GenericMessage<Object>(MESSAGE_BODY));

        assertMockEndpointsSatisfied();
    }

    @Test
View Full Code Here

                latch.countDown();
                assertEquals("Get the wrong result", MESSAGE_BODY + " is processed",  message.getPayload());
            }           
        });

        requestChannel.send(message);

        assertTrue(latch.await(1, TimeUnit.SECONDS));
    }

    @Test
View Full Code Here

                latch.countDown();
                assertEquals("Get the wrong result", MESSAGE_BODY + " is processed",  message.getPayload());
            }           
        });

        requestChannel.send(message);

        assertTrue(latch.await(1, TimeUnit.SECONDS));
    }

    @Override
View Full Code Here

    public void testSendingOneWayMessage() throws Exception {
        MockEndpoint resultEndpoint = getMockEndpoint("mock:result");
        resultEndpoint.expectedBodiesReceived(MESSAGE_BODY);

        MessageChannel outputChannel = getMandatoryBean(MessageChannel.class, "outputChannel");
        outputChannel.send(new GenericMessage<Object>(MESSAGE_BODY));

        assertMockEndpointsSatisfied();
    }

    public ClassPathXmlApplicationContext createApplicationContext() {
View Full Code Here

            org.springframework.integration.Message siOutMessage =
                SpringIntegrationBinding.storeToSpringIntegrationMessage(exchange.getOut());

            // send the message to spring integration
            log.debug("Sending {} to ReplyChannel: {}", siOutMessage, reply);
            reply.send(siOutMessage);
        }       
    }  

}
View Full Code Here

            //Check the message header for the return address
            response = SpringIntegrationBinding.storeToSpringIntegrationMessage(outExchange.getOut());
            if (replyChannel == null) {
                MessageChannel messageReplyChannel = (MessageChannel) message.getHeaders().get(MessageHeaders.REPLY_CHANNEL);
                if (messageReplyChannel != null) {
                    result = messageReplyChannel.send(response);
                } else {
                    throw new MessageDeliveryException(response, "Cannot resolve ReplyChannel from message: " + message);
                }
            } else {
                result = replyChannel.send(response);
View Full Code Here

            public void handleMessage(Message<?> message) {
                String result = (String) message.getPayload();
                assertEquals("Get the wrong result", MESSAGE_BODY + " is processed",  result);               
            }            
        });
        requestChannel.send(message);
    }

    public ClassPathXmlApplicationContext createApplicationContext() {
        return new ClassPathXmlApplicationContext("org/apache/camel/component/spring/integration/twoWayConsumer.xml");
    }
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.