SpringBoot project to demo Session Clustering with Hazelcast by creating cluster using Eureka
To start the application.
- cd eureka-server
- mvn clean install && java -jar target\eureka-server-0.1-SNAPSHOT.jar
- New terminal
- cd hazelcast-eureka-session-clustering/
- mvn spring-boot:run
- New terminal
- Edit application.yml to change the port to 8080
- mvn spring-boot:run
There will be two applications running one on port 8080 and the other on port 8081.
Now to test if session clustering is working.
Hit localhost:8080/testing on one browser tab Hit localhost:8081/testing on the other browser tab
There is a count that is stored in HttpSession, we should be able to increase the count from any one of the browser tab and that should be reflected on the other browser tab.