Memcached with Spring

I have a Spring-based application that uses Spring server, Spring MVC and Spring Data (Mongo) on the server side and is designed as a typical three-tier application.

I have a list of services that are typical Spring services / beans that I want you to integrate with memcached to cache some of my service results.

Can someone lead me to the steps for integrating memcached with Spring for such an application? The sample / tutorial / blog that provides a step-by-step process will be just great.

Thanks.

+4
source share
2 answers

If you are using Spring 3.1, see Spring Cache abstraction. This is the easiest way to integrate caching into a Spring application. Unfortunately, Spring does not support memcached out of the box, only ehcache is supported there.

As far as I know, there is not a single provider that can store data in memcached via Spring Cache. In a few days, the next version 3.0.0 Simple Spring Memcached will be released with this support. On average, you can try one of the latest snapshots or use Simple Spring Memcached 2.0.0 directly without Spring cache abstraction.

UPDATE : Simple Spring Memcached 3.0.0 with Spring Integration with the cache is already available.

+4
source

This is very trivial. You can see the 3levelmemcache project as an example on the github of its Spring abstraction.

0
source

All Articles