Pooling framework for Memcached

Since a long time I wanted a pooling framework for Memcached API, so I decided to build one. Its fairly straight forward to use and modify, you can get the source code from my Git repository.

Following are the steps to get it up and running.

  1. Import the project in Eclipse
  2. Add the following jars to the project as they are needed for the project to compile
    1. commons-logging.jar  (http://commons.apache.org/logging/download_logging.cgi)
    2. commons-pool-1.5.6.jar   (http://commons.apache.org/pool/download_pool.cgi)
    3. junit.jar     (http://sourceforge.net/projects/junit/)
    4. memcached-2.5.jar   (http://code.google.com/p/spymemcached/downloads/list)
  3. I have included JUnit test, just in case !
  4. The settings to connect to the Membase/Memcache server are in the pooling.properties file (memcached.server)
  5. Pool size can be set in the same file (memcached.poolObjects)
  6. API currently implements SET,GET and DELETE methods, feel free to extend it and let me know, I will be more than happy to update the code.

Usage:

	private CachingBroker cb = new CachingBroker();

	cb.set("key" ,TTL, "value");   // set
	cb.get("key");                     // get
	cb.delete("key");	        // delete

 

Happy Coding
/srm