Skip to content
Sample code using the Spring MVC 3.2, Servlet-based, async support
Java JavaScript
Find file
Pull request Compare This branch is 17 commits ahead, 22 commits behind master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


A distributed version of the Spring MVC 3.2 chat sample using Redis for persistence.


There is a bug in Tomcat that affects this sample. Please use Tomcat 7.0.32 or higher.


For this version of the sample you will need to download, install, and start a Redis instance, which can be done in just a few minutes following the quickstart steps. Later on you may also find it helpful to refer to the Spring Redis reference documentation.

Eclipse users, run mvn eclipse:eclipse and import the project. Or just import the code as a Maven project into IntelliJ, NetBeans, or Eclipse.


While the sample is running, you can send commands through the Redis command-line interface:

$ redis-cli

For example to view the chat backlog:

redis> LRANGE chat:archive 0 -1

To clear the chat backlog:

redis> DEL chat:archive

To post a message and send a notification to all running spring-mvc-chat web applications:

redis> RPUSH chat:archive "hello from the redis cli"
redis> PUBLISH chat "a new chat message was posted"

You should see the effects of these commands through the browser interface or in the log output.

Something went wrong with that request. Please try again.