Tropical Software Observations

09 November 2009

Posted by Teo Choong Ping

at 4:00 PM

1 comments

Labels:

Get Started with Redis and Groovy with JRedis

  1. Once you got Redis up and running you need to grab a copy of JRedis.
  2. Using GroovyConsole, run this command to include the JRedis jar: "grailsConsole -cp jredis-core-all.jar"
  3. Execute this sample code:


import org.jredis.*
import org.jredis.ri.alphazero.*
import org.jredis.ri.alphazero.support.*


def redis = new JRedisClient();
redis.set("test", "Hello world")
def result = redis.get("test")
assert DefaultCodec.toStr( redis.get("test") ) == "Hello world"

02 November 2009

Posted by Teo Choong Ping

at 4:59 PM

2 comments

Grails eh-cache plugin note

Just a couple of notes to those thinking of using eh-cache for caching their Grails apps.

  1. Latest version install from command line 0.2 (dist-ehcache)
  2. Out of the box, the taglib is missing, see this Nabble thread
  3. Out of the box, def get(Serializable key, boolean isCacheDistributed) is missing, you have to DIY here.
  4. You can view the cache status by http://localhost:8080/cacheStatus if this is not obvious to you.