Class RedisModule

java.lang.Object
io.jooby.redis.RedisModule
All Implemented Interfaces:
Extension

public class RedisModule extends Object implements Extension
Redis module: https://jooby.io/modules/redis.

Usage:


 {
   install(new RedisModule());

   get("/", ctx -> {
     StatefulRedisConnection redis = require(StatefulRedisConnection.class);
     // work with redis
   });
 }
 
application.conf:
   redis = "redis://localhost:6379"
 
Module is built on top of lettuce. Once installed you are able to work with:
  • io.lettuce.core.RedisClient
  • io.lettuce.core.api.StatefulRedisConnection
  • io.lettuce.core.pubsub.StatefulRedisPubSubConnection
Alternative you can pass a redis URI:
   install(new RedisModule("redis://localhost:6379"));
 
Since:
2.8.5
Author:
edgar
  • Constructor Details

    • RedisModule

      public RedisModule(@NonNull String value)
      Creates a new redis module. Value must be: - Valid redis URI; or - Property name
      Parameters:
      value - Redis URI or property name.
    • RedisModule

      public RedisModule()
      Create a new redis module. The application configuration file must have a redis property, like:
         redis = "redis://localhost:6379"
       
  • Method Details