Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Sample code using the Spring MVC 3.2, Servlet-based, async support

branch: redis

This branch is 17 commits ahead and 22 commits behind master

Octocat-spinner-32 src Upgrade to Spring Framework 4.0.1 February 12, 2014
Octocat-spinner-32 .gitignore Minor polish May 11, 2012
Octocat-spinner-32 Update README November 04, 2012
Octocat-spinner-32 pom.xml Upgrade to Spring Framework 4.0.1 February 12, 2014


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.