You can try to leverage the direct enpoint to break the big route into smaller ones.
Here is an example
from("xxx").choice()
   when(...).to("direct:simple").end().
   when(...).to("direct:last").end();

from("direct:simple").to("xxx");
from("direct:last").to("xxx");

On Thu Feb  9 01:33:38 2012, Christos Vasilakis wrote:
Hi there,

first of all many thanks for your excellent work!. It really makes my life 
easier!

I am newcomer to camel so please bear with me ;)

I have the following route:

                from("switchyard://ServiceRRDRoute").routeId("ServiceRRDRoute")
                .wireTap("jms:svc_rrd_audit?connectionFactory=#JmsXA")
                .choice()
                        
.when(header("ServiceRRD_msg_type").isEqualTo("fetchGraphSimple"))
                                .unmarshal().json(JsonLibrary.Jackson, 
FetchGraphSimpleCommandMessage.class)
                                
.dynamicRouter(bean("bean:RecipientListBean?method=processSimpleGraph"))
                                .log("fetchGraphSimple request send to 
consumers.")
                                .end()
                        
.when(header("ServiceRRD_msg_type").isEqualTo("fetchLast"))
                                .unmarshal().json(JsonLibrary.Jackson, 
FetchLastCommandMessage.class)
                                
.to("bean:RecipientListBean?method=processFetchLast")
                                .recipientList(header("ServiceRRD_recipients"))
                                .log("fetchLast request send to consumers.")

But I get a compile error
        cannot find symbol method when(org.apache.camel.Predicate)

Basically the second when() fails to compile?

This means that in the choice() I can't use dynamicRouter() and recipientList() 
together? Or is there any other way to accomplish this

Thanks for all your help

Regards,
Christos







--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
        http://jnn.javaeye.com (Chinese)
Twitter: willemjiang Weibo: willemjiang

Reply via email to