Hi

You can most likely do this with some xpath expression, but xpath can
be a bit tricky to get working.

The simple language have operator support, but you would need to
extract the 123 number from the xpath first
and set it in a temporary header

.setHeader("subno").xpath("/API/Subno/text()")
.choice()
  .when().simple("${header.subno} range 100..199").to("aaa")
  .when().simple("${header.subno} range 200..299").to("bbb")
  .otherwise().to("ccc")
.end();

The simple language also supports > operator so you can do it like

  .when().simple("${header.subno} >= 100 && ${header.subno} < 200).to("aaa")

Mind that the simple language was refactored a bit in Camel 2.9.0 so
read the page
http://camel.apache.org/simple




On Wed, Mar 14, 2012 at 3:02 PM, Omar Atia <[email protected]> wrote:
> Dear All,
>
> I have XML contains subscriber number :
>
> <API><Subno>123</Subno></API>
>
> We are having number ranges to send http request to one of three servers.
>
> 100-->200  Loadbalancer A.
> 200-->300 Loadbalancer B.
> 300-->400 Loadbalancer C.
>
> How to implement that in simple language ? I need to decide based on the 
> subno coming inside the XML , value should be compared to lower and upper 
> value in the range .
>
> Appreciate your feedback,
>
> Thanks,
> Omar Atia



-- 
Claus Ibsen
-----------------
FuseSource
Email: [email protected]
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Reply via email to