question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using play-redis AND ehcache?

See original GitHub issue

This isn’t an issue, but a question. Is it possible to use both ehcache and play-redis? I was goofed around with the configuration for a bit, but was never able to make play-redis and ehcache run together. A subset of what I had configured is as follows.

I have a file called redis.conf:

play.cache.redis {
  bind-default = false

  # source property; standalone is default
  source: standalone

  instances {
    history-cache {
      host: localhost
      port: 6379
    }
  }
}

In application.conf I’ve enabled the module as follows:

play.modules.enabled += "play.api.cache.redis.RedisCacheModule"

The problem is when I try to inject an instance of CacheAsyncApi I get an error indicating No implementation for play.api.cache.redis.CacheAsyncApi was bound.. Presumably this is doe to the bind-default = false statement? If I remove that I get various other issues related to having to define the play cache, which is the default as mentioned in the docs.

Is there an example anywhere of running both caches?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:22 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
tech-samcommented, Jan 5, 2018

Thanks Karel , truly appreciate your contribution towards community !!

1reaction
aledeulocommented, Mar 24, 2021

Hi @KarelCemus, following the Scala sample was very easy to transport it into Java code, I have the full integration working without any issues at the moment.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Multiple Play CacheApi instances? - Google Groups
Hi,. We've been using the default ehcache in-memory cache for our application via DI of AsyncCacheApi instances. However, we now have ...
Read more >
Using Ehcache
Introduction. Ehcache can be used directly. It also supports use with the popular Hibernate Object/Relational tool and caching with the Java EE Servlet....
Read more >
play-redis - Scaladex
This plugin provides support for Redis using the best Java driver Jedis. ... you would if you were using EhCacheComponents from the reference...
Read more >
Introduction To Ehcache - Baeldung
3. Cache Configuration · The first way is through Java POJO where all configuration parameters are configured through Ehcache API · The second...
Read more >
Using play-redis AND ehcache? - play-redis - GitAnswer
This isn't an issue, but a question. Is it possible to use both ehcache and play-redis? I was goofed around with the configuration...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found