Running spring-session-redis

Hi,

We’re using Vaadin 8.5.4, Spring Boot 2.0.4 and Tomcat 9.0.10. We tried downgrading Vaadin but it fails the same.

We’re trying to use the spring-session-redis addon. So far, we’re able to serialize the sessions and send them to redis with the embbeded tomcat/jetty webservers, but when we try with an standalone webserver (Tomcat or WildFly) we get the famous ‘Communication Error’.

We are already using Vaadin 7 + charts and we’re working on reimplementing our backoffice using Vaadin 8, and one thing we really need is to be able to clusterize the backend. Any idea why it would fail using an standalone webserver but run fine with mvn spring-boot:run

Best,

Gustau

In short, it won’t work unless you implement a way to lock the session to ensure that threads get exclusive access to it. There is some discussion about this in https://github.com/vaadin/framework/issues/9188 and https://github.com/vaadin/framework/pull/9189

The best approach for clustering is typically to use sticky sessions so you route the same user to the same machine and have the session available there, without needing to serialize/deserialize the session all the time

Thanks Artur for your reply. I didn’t see those posts. In my setup I’m using the following Vaadin add-on:

https://vaadin.com/directory/component/spring-session-redis

which I don’t see being used in those posts.

Using that add-on should allow it to work, in fact I have that setup working with the embedded Tomcat/Jetty artifact. I see the session being saved in the redis server just fine and if kill the deploy and run it back it’s able to restore the sessions.

However the resulting application fails when deployed inside a standalone server. This is when I see the feared ‘Communication Error’ message.

Any idea would be appreciated.

Best,

Gustau