Hi guys.
I've just tried to make my first HelloWorld spring-integration app, and got the exception: No bean named 'internal.MessageBus' is defined.
Here is my context:
HelloService class:Code:<beans:beans xmlns="http://www.springframework.org/schema/integration" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-1.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd"> <message-bus/> <beans:bean id="helloService" class="com.integration.HelloService"/> <endpoint input-channel="inputChannel" default-output-channel="outputChannel" handler-ref="helloService" handler-method="sayHello" /> </beans:beans>
here is how I run the example:Code:package com.integration; public class HelloService { public String sayHello(String name) { return "Hello" + name; } }
Could you please point me on whats whrong here?Code:ApplicationContext context = new ClassPathXmlApplicationContext("integrationContext.xml"); ChannelRegistry channelRegistry = (ChannelRegistry) context.getBean(MessageBusParser.MESSAGE_BUS_BEAN_NAME); MessageChannel inputChannel = channelRegistry.lookupChannel("inputChannel"); MessageChannel outputChannel = channelRegistry.lookupChannel("outputChannel"); inputChannel.send(new StringMessage(new Integer(1),"World")); System.out.println(outputChannel.receive().getPayload());
Thanks.


Reply With Quote