How can I group spring mvc application?

I have a web application written using spring on a mooring server. due to load balancing, I have to replicate http sessions and spring security context on web servers.

Can someone point me to a working example of how to make this possible?

mvc controllers are part of spring-security-oauth2, so I have limited ability to influence them, and the berth is a prerequisite for our environment. for most of the data and caching we will use infinispan.

I could not find current information on how tu-cluster is from spring, so I am grateful for every help.

+7
source share
2 answers
  • What is stateless, automatically scales (for example, most Spring beans and controllers)

  • What is shared must be replicated, or all instances of the cluster should be divided into

    • HTTP sessions must be replicated. If they are, Spring Security (which maintains a security context in the session will only work

    • The database will work - you either simply use it or replicate it.

    • Infinispan must handle in-memory cache replication

If you only store Serializable elements in an HTTP session and in caches, clustering your application should work. Watch out for synchronized code (should locks propagate?) And stateful beans.

see also

+7
source

Although I'm late, I think spring-knowledge might be a potential candidate. See the solution in another Stackoverflow question.

Session replication with Spring and Hazelcast session on top of Tomcat / Jetty

Spring-session Docs

+3
source

All Articles