camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: newbie help
Date Tue, 29 Dec 2009 08:14:59 GMT
yaog wrote:
> Hi,
> 
> I am a newbie with Camel.
> 
> 1. how does the routesBuilder work in IDS? simple "from" and "to in code of
> course does not compile...
Sorry , what's IDS?

> 
> 2. I have the following spring section:
> 
> 
> 	<bean id="compA" class="com.XXX.CompA">
> 	</bean>
> 
> 	<bean id="compB" class="com.XXX.CompB">
> 	</bean>
> 
> 	<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
> 		<camel:template id="camelTemplate" />
> 		<route>
> 			<from uri="bean:compA" />
> 			<to uri="bean:compB" />			
> 		</route>
> 	</camelContext>
> 
> 
> In My Main I do this:
> 
> 
> 		ApplicationContext context = new
> ClassPathXmlApplicationContext("spring-camel-context.xml");
> 		ProducerTemplate producerTemplate =
> (ProducerTemplate)context.getBean("camelTemplate");
> 		producerTemplate.sendBody("bean:compA", ExchangePattern.InOut, "message");
> 
> 
> But I see it gets to compA but not to compB. what is the problem?
> 
> from logs looks like route is built ok:
> 
> Route 0: EventDrivenConsumerRoute[Endpoint[bean://compA] ->
> Instrumentation:route[UnitOfWork(Channel[sendTo(Endpoint[bean://compB])])]]
> 
> Please advise.
It could be your compB has more than one method :)
Can you try to use the producerTemplate to send the message to 
bean:compB to see if the compB can be invoked ?
Can you try to enable trace in the camelContext like this, to see more 
log trace?

<camelContext id="camel" trace="true" 
xmlns="http://camel.apache.org/schema/spring">
  		<camel:template id="camelTemplate" />
  		<route>
  			<from uri="bean:compA" />
  			<to uri="bean:compB" />			
  		</route>
</camelContext>

> 
> Thanks.
> 
> 

Willem

Mime
View raw message