简体   繁体   中英

Apache Camel Sticky Http Routing

I want to use apache camel's sticky load balancing to proxy HTTP into Tomcats.

The problem is that sticky load balancer fallbacks to round-robin if it hasn't seen expression value before.

So every request that is proxied goes to another node (as it contains JSESSIONID that load balancer doesn't know). Node answers with a new session, which after I refresh browser won't be taken into account by load balancer cause it doesn't now that ID!

How should I organize Sticky http to http routing with apache camel?

You can build your own load balancer, or extend the existing load balancer, and provide your own logic how to balance.

Just think how you would implement a solution for this use-case without Camel, eg how would the algorithm be. And then implement that algorithm in your custom load balancer.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM