I have a web application written with spring on a jetty server. because of load balancing i have to replicate http sessions and spring-security contexts over the web servers.
Can anybody point me at a working example how to make this possible?
the mvc controllers are part of spring-security-oauth2 so i have limited ability to influence them and jetty is a prerequisite for our environment. for most of the data and caching we will use infinispan.
I could not find any current information how tu cluster with spring, so i'm grateful for every help.
What is stateless, scales out automatically (like most of Spring beans and controllers)
What is shared, must be replicated or all instances in the cluster must share on
HTTP sessions must be replicated. If they are, Spring security (which stores security context in the session will just work
Database will just work - you'll either just use one or replicate it as well
Infinispan should handle replication of in-memory caches
Providing that you only store Serializable
items in HTTP session and in caches, clustering your application should just work. Watch out for synchronized code (should locks be distributed?) and stateful beans.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With