Tropical Software Observations

09 November 2009

Posted by Unknown

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"

1 comments:

Unknown said...

Could this be a mistake?
Using GroovyConsole, run this command to include the JRedis jar: "grailsConsole -cp jredis-core-all.jar"