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

 

Also, don’t forget  to leave a comment if you like it or even criticize it if you don’t.

Happy Coding
/srm

  1. How to make this work with Visual Basic? I have the Visual Studio 6 with Windows XP. Does this soft work on the Visual Basic?

    • Hi Wu,
      It should work but then its a bit of a hassle to make it work with VB. You can compile this project and use it with VB as mentioned here

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>