Instead of using camel-cxf component, this is most effective way to do the load 
balancing. 
I think you can do some tracing work to see if the xpath expression return the 
right ServiceGroupID first. 
Then we can keep digging if the sticky load balancing is doing its job.

-- 
Willem Jiang

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





On Wednesday, September 12, 2012 at 3:33 PM, balkishore wrote:

> Hi I would like to perform sticky load balncing in apache camel based on the
> SOAP session, whcih is embedded in ServiceGroupID node of the first
> response.
> 
> I wrote a small route as follow:
> 
> from(uri)
> .loadBalance().sticky(xpath(query).namespaces(env).namespaces(wsa).namespaces(ax))
> .to(BE1,BE2);
> 
> Where URI is the string to which the requests are passed and BE1 and BE2 are
> the two backend servers.
> 
> And my query is 
> 
> String query =
> "/soapenv:Envelope/soapenv:Header/wsa:ReplyTo/wsa:ReferenceParameters/axis2:ServiceGroupId/text()";
> 
> If i am not wrong this query would extract the servicegroupID from my SOAP
> header.
> 
> But when I try to perform the balancing, due to some reason whatsoever, the
> requets are not being passed to the same backend server.
> 
> and my env, wsa and ax are the namespaces, which are :
> 
> Namespaces env = new Namespaces("soapenv",
> "http://schemas.xmlsoap.org/soap/envelope/";);
> Namespaces wsa = new Namespaces("wsa",
> "http://www.w3.org/2005/08/addressing";);
> Namespaces ax = new Namespaces("axis2",
> "http://ws.apache.org/namespaces/axis2";);
> 
> Am I doing something wrong here?
> If so what? I would appreciate any help.
> 
> 
> 
> 
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Performing-Sticky-load-balancing-in-Camel-tp5719170.html
> Sent from the Camel - Users mailing list archive at Nabble.com 
> (http://Nabble.com).



Reply via email to