Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Memcached support #7652

Merged
merged 1 commit into from May 23, 2018
Merged

Add Memcached support #7652

merged 1 commit into from May 23, 2018

Conversation

jdubois
Copy link
Member

@jdubois jdubois commented May 18, 2018

Memcached can be used as a Spring Cache implementation, but not as an Hibernate L2 cache.
This is great for people running in cloud environments like AWS, GCP, Heroku, as those platforms provide cheap Memcached support, allowing the applications to scale easily without hitting the database too hard.

Ping @jkutner we'll need to add support for the MemCachier add-on with Heroku!

Memcached can be used as a Spring Cache implementation, but not as an Hibernate L2 cache.
This is great for people running in cloud environments like AWS, GCP, Heroku, as those platforms provide cheap Memcached support, allowing the applications to scale easily without hitting the database too hard.

Ping @jkutner we'll need to add support for the MemCachier add-on with Heroku!
@jdubois jdubois merged commit e20a8e5 into jhipster:master May 23, 2018
@jkutner
Copy link
Contributor

jkutner commented May 25, 2018

@jdubois @jhipster/developers I'm sad to report that there are some serious issues with com.amazonaws:elasticache-java-cluster-client, which is used by memcached-spring-boot-starter. In short, elasticache-java-cluster-client does not work with usernames and passwords.

You can see why this happens in MemcachedClient. If authDescriptor is set, a NPE will always be thrown:

Caused by: java.lang.NullPointerException: null
 at net.spy.memcached.MemcachedClient.addObserver(MemcachedClient.java:2991)
 at net.spy.memcached.MemcachedClient.<init>(MemcachedClient.java:297)
 at net.spy.memcached.MemcachedClient.<init>(MemcachedClient.java:235)
 at io.sixhours.memcached.cache.MemcachedCacheManagerFactory.memcachedClient(MemcachedCacheManagerFactory.java:83)

In fact, I was only able to get this error by patching memcached-spring-boot-starter to support username and password.

elasticache-java-cluster-client is a fork of the very old and very dead spymemcached. But elasticache-java-cluster-client also seems very dead.

At this point, adding support on Heroku would require significant work to these libraries. I have to recommend that we switch to this somehow:

<dependency>
  <groupId>com.googlecode.xmemcached</groupId>
  <artifactId>xmemcached</artifactId>
  <version>2.4.3</version>
</dependency>

But I know that may not be possible.

I'l be very happy to add Redis support in the future though!

@jkutner
Copy link
Contributor

jkutner commented May 25, 2018

Here's my WIP branch

@jdubois jdubois deleted the memcached-2 branch May 26, 2018 05:58
@jdubois
Copy link
Member Author

jdubois commented May 26, 2018

Oh @jkutner I should have asked you, you seem to know this far better than I do!!!! And I also realize that very few people seem to use Memcached with Java, let's change this as it's an awesome option!

  • Yes let's switch to "xmemcached", the project looks much more popular. Can you do a PR? Do you want me to work on this?
  • Once this is done, Redis support should be very easy, yes a PR is highly welcome

I'm creating 2 tickets for those and will assign them to you, if that's OK for you

This was referenced May 26, 2018
@jdubois jdubois added this to the 5.0.0-beta.2 milestone Jun 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants