Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9C1BCD80B for ; Mon, 10 Sep 2012 13:18:33 +0000 (UTC) Received: (qmail 27909 invoked by uid 500); 10 Sep 2012 13:18:33 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 27868 invoked by uid 500); 10 Sep 2012 13:18:33 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 27859 invoked by uid 99); 10 Sep 2012 13:18:33 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Sep 2012 13:18:33 +0000 X-ASF-Spam-Status: No, hits=0.6 required=5.0 tests=NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of willem.jiang@gmail.com designates 209.85.160.45 as permitted sender) Received: from [209.85.160.45] (HELO mail-pb0-f45.google.com) (209.85.160.45) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Sep 2012 13:18:26 +0000 Received: by pbbrp12 with SMTP id rp12so1143466pbb.32 for ; Mon, 10 Sep 2012 06:18:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:message-id:in-reply-to:references:subject:x-mailer :mime-version:content-type:content-transfer-encoding :content-disposition; bh=qwlRN/QqfpVyBFDxuNO/Fto6EFyr9+aDnq4nsugr7po=; b=FZW/UyKY6ly4Rdf15Rrt0/kHvU+kVN21Kg1PjdHfdHJAEdaHCpVlq3y1p1jKd+tb+b F6UPB+Do6meJR4bWkz3ZuiY7M4Tugw+5m50InBqK2+MSjIejo/OTAtWk4g2Xj2YsK/rr hk2fv1G1bfMouYOSK06vCLScLil3QrifdAYj7m5Kfw9D22jAbqpED2KjFAwXqZsWq4RO Hu+aUnO0T4a7qUq4HZi/9MiBrWnSWz95FsZyQAY3Xi8cekcazy1VF9Ap0YD20My9dgsh GhEb/FUJb6lF7LeDMO0GddwCMTAsu4VDD+rmgJeNZ4erOe/UCfTIgZ0m3NGVUEUKRWE0 9nNw== Received: by 10.68.211.105 with SMTP id nb9mr6128154pbc.67.1347283085509; Mon, 10 Sep 2012 06:18:05 -0700 (PDT) Received: from [192.168.1.100] ([123.116.45.91]) by mx.google.com with ESMTPS id qb6sm8060192pbb.18.2012.09.10.06.18.01 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 10 Sep 2012 06:18:03 -0700 (PDT) Date: Mon, 10 Sep 2012 21:17:55 +0800 From: Willem jiang To: users@camel.apache.org Message-ID: <6ABACBE05CF54FE1BDD3AE68FCBE8550@gmail.com> In-Reply-To: <1347269116033-5719015.post@n5.nabble.com> References: <1347269116033-5719015.post@n5.nabble.com> Subject: Re: SOAP session handling in load balncer X-Mailer: sparrow 1.6.3 (build 1164) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline 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).