Thomas - 2012-12-03

Java driver for the Redis datastore

Goals - for the core alpha version:

  • Developers can import the project artifact and work with connections to the Redis datastore immediately following coding examples
  • Simplicity of interface and implementation
  • The data types transmitted are binary data types - byte[] and String using UTF-8 encoding
  • Client is responsible for parsing and converting the data to its desired data objects or formats

Implementation types

  • Synchronous I/O in the "core"
  • Asynchronous I/O using the Apache MINA project under 'mina' subproject
  • Asynchronous I/O using new Java 7 features - planning phase

Dependencies:

  • Java 1.6
  • Apache MINA 2.0.x for the 'mina' subproject

Example code:

            import net.dikte.redis.connect.Connection;
            import net.dikte.redis.connect.ConnectionPool;
            ...
            ConnectionPool pool;
    Connection c = null;
    try {
        c = pool.get();
       List<Object> args = new ArrayList<Object>();
       args.add("a");

       Request rr = new Request();
       rr.setArgs(args);
       rr.setCommandWord("GET");
       Reply r = c.sendAndReceive(r);
               // show reply
    }
    finally
    {
        pool.release(c);
    }