Hi Muhammad,
I think the error must be in your iMessageUtil class. This route works
as you would expect:
public class CamelTestRoutingSlip extends CamelTestSupport {
public void testRoutingSlip(){
template.sendBody("direct:foo", "foo");
}
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
from("direct:foo")
.setHeader("routing", constant("direct:a,direct:b"))
.routingSlip("routing")
.to("log:MAIN?showAll=true");
from("direct:a")
.setHeader("a", constant("_a"))
.to("log:A");
from("direct:b")
.setHeader("b", constant("_b"))
.to("log:B");
}
};
}
}
Best regards - Claus
On 03.05.2011 10:23, Muhammad Ichsan wrote:
Dear All,
Is it possible to use inOut in routingSlip? In the following context,
the destination is visited asynchronously instead of - my expectation
- synchronously. Why this happens?
<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="activemq:channel.in" />
<to uri="direct:invoke" />
<to uri="bean:consumer?method=consume" />
</route>
<route>
<from uri="direct:invoke" />
<to uri="bean:iMessageUtil?method=createRoutingSlip" />
<setExchangePattern pattern="InOut" />
<routingSlip>
<header>nextDestination</header>
</routingSlip>
<to uri="bean:iMessageUtil?method=iAmBack" /><!-- THIS
PART
strangely is never reached -->
</route>
<!-- ============== Destinations ============== -->
<route>
<from uri="activemq:itm.in" />
<to uri="bean:iMessageUtil?method=invokeItm" />
</route>
<route>
<from uri="activemq:abt.in" />
<to uri="bean:iMessageUtil?method=invokeAbt" />
</route>
</camelContext>
Thanks