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
Redis cache support #10057
Redis cache support #10057
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! I tried it and the cache is correctly used.
2 other things:
- you could change the logger for redisson
<logger name="org.redisson" level="WARN"/>
as it's done for infinispan (a lot of logs are currently shown) - it would be nice to have the information in the readme that a redis instance has to be launched with Docker Compose in order to start the app
generators/server/templates/src/main/java/package/config/CacheConfiguration.java.ejs
Outdated
Show resolved
Hide resolved
generators/server/templates/src/main/java/package/config/CacheConfiguration.java.ejs
Outdated
Show resolved
Hide resolved
@Tcharl @jdubois @anthonyrichir @PierreBesson could you have a look at this PR? |
There is something strange. It looks like the jhipsterProperties doesn't have the property: |
@PierreBesson We currently only supporting enabling/disabling cache on memcached not for others. Memcached is using Spring Cache and it exists NoOpCacheManager in order to disable the caching. However since this implementation is using JCache I am not sure if we have something similar. |
Normally it is just necessary to add to app.yml: spring:
cache:
type: none |
So nothing to do in our hand? Except maybe to explain it in the README? |
@DanielFran Nice thanks ! @hdurix I think so, here we just need to avoid to instantiate a RedisClient when the cache is none but if the cache is disabled, the user should also manually disable hibernate 2nd cache level if there is one since hibernate share the same CacheManager |
@Shaolans I do not believe you need to add your last commit since the cache will not be used if deactivated in configuration file. |
@DanielFran Even if we disable the cache, I think it will still instantiate a redis client and the HibernatePropertiesCustomizer bean will error since there is no cacheManager. Or is it up to the dev to do it ? EDIT: I removed the commit. |
21c959c
to
521eaa4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Shaolans I'm just wondering how you were able to build the project when getRedis() is undefined? Thanks.
@JackyC415 Hello you need to build the jhipster server library first by running |
@Shaolans : just tested it and it works well. Good job ! But I have a comment:
|
Another comments too:
|
If possible, once it's merged, if you can add a dedicated build at https://github.com/hipster-labs/jhipster-daily-builds it would be great ! |
You are totally right ! @pascalgrimaud According to you which one do you think we should use ?
I was planning on doing it, if the PR was good enough.
Thanks for reminding me it, I totally forgot that case.
I was planning do it, once merge :) ! I will probably work on these points next week. |
@Shaolans : Thanks. What I prefer in order:
|
@jdubois Do you have time to review this PR since you were interested in? |
any update on this? seems still not merged into master branch yet... |
@TonyLuo : there is still an issue with integration tests, that's why it's not ready to be merged yet |
generators/server/templates/src/main/java/package/config/CacheConfiguration.java.ejs
Outdated
Show resolved
Hide resolved
generators/server/templates/src/main/java/package/config/CacheConfiguration.java.ejs
Outdated
Show resolved
Hide resolved
Good work @Shaolans really looking forward to have it merged! |
Very good job @Shaolans ! |
Bug bounty claimed https://opencollective.com/generator-jhipster/expenses/10211 |
for some reason on version v6.10.4 I faced an issue with ExtendWith annotation not being imported in the AccountResourceIT class. My config is Okta and i used Redis for cache. |
@sinaghazi : plz open a new ticket with all information so we can try to reproduce |
Please make sure the below checklist is followed for Pull Requests.
Travis tests are green
Tests are added where necessary
Documentation is added/updated where necessary
Coding Rules & Commit Guidelines as per our CONTRIBUTING.md document are followed
This is my implementation of redis cache for the generator. Here you can check a example of an application generated with redis cache https://github.com/Shaolans/jhipster-app-redis-sample.
It uses this branch of Jhipster jhipster/jhipster#324.
Fix #9280