camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem jiang <willem.ji...@gmail.com>
Subject Re: SOAP session handling in load balncer
Date Mon, 10 Sep 2012 13:17:55 GMT
You can use the StickyLoadBalancer[1] with expression which takes the value from the session
id to make sure camel send the request to same back end server if the session id is same.

[1]http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/processor/loadbalancer/StickyLoadBalancer.html


-- 
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 Monday, September 10, 2012 at 5:25 PM, balkishore wrote:

> Dear members,
> I have been playing and working around with apache camel for quite a while
> now.
> And i would like to thank the developers for producing such a awesome piece
> of software suite.
> 
> Now my question is how can I enable load balancing via SOAP sessions in
> apache camel.
> I would like the request to be forwarded to the same server, to which the
> previous request was forwarded. My requests are SOAP with SOAP session
> enabled. Hence for each transaction a unique session id would be generated.
> How can i forward the all the requests with the same session id to a single
> server? Well below is my source code.
> 
> *public class LoadBalancer {
> public static void main(String args[]) throws Exception {
> CamelContext context = new DefaultCamelContext();
> 
> context.addRoutes(new RouteBuilder() {
> 
> public void configure() {
> 
> 
> from("jetty://http://0.0.0.0:8080?matchOnUriPrefix=true")
> 
> {
> 
> private Exchange e;
> 
> public void process(Exchange exchange) throws Exception {
> System.out.println("Received exchange:" + e.getIn());
> }
> });*/
> .to("log:com.transcat.order?level=INFO")
> .loadBalance().roundRobin()
> 
> .to("http://vmxp22-sat-1:8080?throwExceptionOnFailure=false&bridgeEndpoint=true","http://vmxp22-sat-2:8080?throwExceptionOnFailure=false&bridgeEndpoint=true");
> }
> }); *
> 
> 
> 
> 
> --
> View this message in context: http://camel.465427.n5.nabble.com/SOAP-session-handling-in-load-balncer-tp5719015.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).




Mime
View raw message