Hi,
I have reduced my code to the simplest code.
This code goes perfectly:
<route>
<camel:from uri="cxfrs:/exchange2...." />
<camel:bean ref="orderServiceRest" method="buy('symbol', 'quantity',
'price')" />
</route>
but this one goes wrong:
<route>
<camel:from uri="cxfrs:/exchange2...." />
<camel:dynamicRouter>
<method ref="routeHelper" method="slip" />
</camel:dynamicRouter>
</route>
public class RouteHelper{
int i = 0;
public String slip(MessageContentsList body){
if (i==0){
i ;
return
"bean:orderServiceRest?method=buy('symbol','quantity','price')";
}
else
return null;
}}
throwing the exception:
WebApplicationException has been caught : Name must have both starting and
ending parenthesis, was: buy('symbol'
I have also tested this case:
<route>
<camel:from uri="cxfrs:/exchange2...." />
<camel:dynamicRouter>
<method ref="routeHelper" method="slip" />
</camel:dynamicRouter>
</route>
public class RouteHelper{
int i = 0;
public String slip(MessageContentsList body){
if (i==0){
i ;
return "bean:orderServiceRest?method=buy('symbol')";
}
else
return null;
}}
and it goes perfectly.
I don't know what I am doing wrong, but I would be very grateful I you could
help me.
Kindest regards
--
View this message in context:
http://camel.465427.n5.nabble.com/Dynamic-Routing-tp5068570p5070967.html
Sent from the Camel - Users mailing list archive at Nabble.com.