All Projects → bizreach → play-redis

bizreach / play-redis

Licence: other
Redis Module for Play Framework

Programming Languages

scala
5932 projects

Projects that are alternatives of or similar to play-redis

play-java-chatroom-example
Example Chatroom with Java API
Stars: ✭ 33 (+200%)
Mutual labels:  playframework
play-java-seed.g8
Play Java Seed template: use "sbt new playframework/play-java-seed.g8"
Stars: ✭ 20 (+81.82%)
Mutual labels:  playframework
play-scala-seed.g8
Play Scala Seed Template: run "sbt new playframework/play-scala-seed.g8"
Stars: ✭ 66 (+500%)
Mutual labels:  playframework
cachecontrol
Minimal HTTP cache management library in Scala
Stars: ✭ 13 (+18.18%)
Mutual labels:  playframework
sbt-play-npm
Integrate a Npm application with Play framework
Stars: ✭ 10 (-9.09%)
Mutual labels:  playframework
play-scala-log4j2-example
An example Play project using Log4J 2 as the logging engine
Stars: ✭ 14 (+27.27%)
Mutual labels:  playframework
sbt-sass
A fork of the sbt-sass repository which seems to be abandoned.
Stars: ✭ 32 (+190.91%)
Mutual labels:  playframework
play-scala-streaming-example
Example Play application showing Comet and Server Sent Events in Scala
Stars: ✭ 42 (+281.82%)
Mutual labels:  playframework
subscriptions-frontend
sites.google.com/a/guardian.co.uk/guardian-subscriptions/
Stars: ✭ 15 (+36.36%)
Mutual labels:  playframework
play-grpc
Play + Akka gRPC
Stars: ✭ 31 (+181.82%)
Mutual labels:  playframework
play-ebean
Play Ebean module
Stars: ✭ 29 (+163.64%)
Mutual labels:  playframework
play-java-fileupload-example
An example Play application showing custom multiform fileupload in Java
Stars: ✭ 13 (+18.18%)
Mutual labels:  playframework
social-graph-api
Authentication & Social Graph API built on top of Redis, Neo4J and Play!
Stars: ✭ 13 (+18.18%)
Mutual labels:  playframework
IDEACodeTools
Intellij IDEA plugin for some code tools
Stars: ✭ 20 (+81.82%)
Mutual labels:  playframework
play-java-rest-api-example
REST API using Play in Java
Stars: ✭ 44 (+300%)
Mutual labels:  playframework
play-scala-compile-di-example
Example Play Project using compile time dependency injection and Play WS with ScalaTest
Stars: ✭ 37 (+236.36%)
Mutual labels:  playframework
play-json-extra
Play Json Extra extends Play Json with several opinionated features
Stars: ✭ 22 (+100%)
Mutual labels:  playframework
playsonify
An opinionated micro-framework to help you build practical JSON APIs with Play Framework (or akka-http)
Stars: ✭ 42 (+281.82%)
Mutual labels:  playframework
scalikejdbc-play-support
Play Framework support
Stars: ✭ 55 (+400%)
Mutual labels:  playframework
MuezzinAPI
A web server application for Islamic prayer times
Stars: ✭ 33 (+200%)
Mutual labels:  playframework

Play Redis Plugin Build Status

A fork of the former official (but not maintained now) redis plugin for Play Framework.

This plugin provides support for Redis using the best Java driver Jedis.

Versions

Plugin version Play version
2.7.1 2.7.x
2.6.1 2.6.x
2.5.1 2.5.x

How to install

Add "jp.co.bizreach" %% "play-modules-redis" % "(plugin version)" to your dependencies.

Features

Configurations

  • Point to your Redis server using configuration settings redis.host, redis.port, redis.password and redis.database (defaults: localhost, 6379, null and 0)
  • Alternatively, specify a URI-based configuration using redis.uri (for example: redis.uri="redis://user:password@localhost:6379").
  • Set the timeout in milliseconds using redis.timeout (default is 2000).
  • Configure any aspect of the connection pool. See the documentation for commons-pool2 GenericObjectPoolConfig, the underlying pool implementation, for more information on each setting.
    • redis.pool.maxIdle
    • redis.pool.minIdle
    • redis.pool.maxTotal
    • redis.pool.maxWaitMillis
    • redis.pool.testOnBorrow
    • redis.pool.testOnReturn
    • redis.pool.testWhileIdle
    • redis.pool.timeBetweenEvictionRunsMillis
    • redis.pool.numTestsPerEvictionRun
    • redis.pool.minEvictableIdleTimeMillis
    • redis.pool.softMinEvictableIdleTimeMillis
    • redis.pool.lifo
    • redis.pool.blockWhenExhausted

Allows direct access to Jedis

Because the underlying Jedis Pool was injected for the cache module to use, you can just inject the Jedis Pool yourself, something like this:

//scala
import javax.inject.Inject
import redis.clients.jedis.JedisPool

import play.api.mvc._

class TryIt @Inject()(jedisPool: JedisPool, cc: ControllerComponents) extends AbstractController(cc) {
  ...
}
//java
import javax.inject.Inject;
import redis.clients.jedis.JedisPool;

import play.mvc.*;

public class TryIt extends Controller {

   //The JedisPool will be injected for you from the module
   @Inject JedisPool jedisPool;

   ...
}

This plugin also supports compile time DI via RedisCacheComponents. Mix this in with your custom application loader just like you would if you were using EhCacheComponents from the reference cache module.

Accessing different caches

Play 2.7 2.6

This plugin supports NamedCaches through key namespacing on a single Jedis pool. To add additional namespaces besides the default (play), the configuration would look like such:

play.cache.bindCaches = ["db-cache", "user-cache", "session-cache"]

Play 2.5

The default cache module (EhCache) will be used for all non-named cache UNLESS this module (RedisModule) is the only cache module that was loaded. If this module is the only cache module being loaded, it will work as expected on named and non-named cache. To disable the default cache module so that this Redis Module can be the default cache you must put this in your configuration:

play.modules.disabled = ["play.api.cache.EhCacheModule"]

This plugin supports play 2.5 NamedCaches through key namespacing on a single Jedis pool. To add additional namespaces besides the default (play), the configuration would look like such:

play.cache.redis.bindCaches = ["db-cache", "user-cache", "session-cache"]

Licence

This software is licensed under the Apache 2 license, quoted below.

Copyright 2018 BizReach (http://www.bizreach.co.jp/).
Copyright 2012 Typesafe (http://www.typesafe.com).

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this project except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].