-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
JHipster+consul rate-limit with prod profile throwing ClassNotFound exception. #7178
Comments
@Puneetsri Please post output of |
proj$ jhipster info JHipster Version(s)
cat: no such file or directory: .yo-rc.json JHipster configuration, a
|
@Puneetsri Please run |
infinity@infinity-ThinkPad-T510:~/Development/projects/tutorial/jhipster/micro6/gateway$ jhipster info JHipster Version(s)
JHipster configuration, a
|
Please note that I've even created one more project with same configurations, with no db at gateway. Again, in dev profile, rate-limit check is working fine. But in prod, i am getting the same exception ('ClassNotFound') as mentioned above. If i disable the rate-limit, everything is fine(of course i lose the rate-limit feature) in both the projects. There seems to be something special in prod profile+rate-limit, as i never have this issue in dev profile+rate-limit. |
Very strange - did you also check with the Bucket4J project? They're doing the integration work here, so the issue might be on their side, and maybe they already know about it |
@jdubois It more seems to be related to hazelcast: hazelcast/hazelcast#8972. |
Can someone please let me know if on 'prod' mode, we start hazelcast & gateway on seperate JVM's? My setup is a single machine setup (one node only) and i think this is not the case by default which is logical. |
No everything is on the same JVM - in fact I'm not aware of any big difference between dev and prod mode here! That's why this is strange. |
I just tried it on the current |
OK I got it, I think, so I'm reopening it. |
I just fixed it, for the record: when I coded this initially, I didn't think there was an interest in this, as you are doing distributed rate limiting on the gateway + using Traefik (so 2 technologies doing the routing). But that was of course a bad idea (typically Traefik doesn't do rate limiting). |
Thanks a Lot @jdubois, when it will be available for use? BTW i did not use Traefik, but just consul (instead of JHipster Registry). |
It will be in the next JHipster 5 release for sure. |
I cherry-picked it here: 4ac275a So it should be in the next 4.x release (but I can't tell when we will do that) |
Perfect, thanks , I'll keep an eye on it. Just a question : Is JHipster 5 release planned in coming 2/3 months? I'm not really sure about the general timelines for JHipster releases, could be helpful to know. |
JHipster 5 should be out sooner, probably 2-3 weeks from now. |
I'm sorry @Puneetsri but cherry-picking this fix on the v4.x_maintenance branch makes our Travis build fail, and I have no time to work on this. So I'm reverting the commit. |
***Apologies if this is not the right project to create the issue in.
Overview of the issue
JHipster+consul rate-limit with prod profile throwing ClassNotFound exception.
Motivation for or Use Case
I am using typical JHipster[4.14.0] microservices stack [brand new project, generated using jhipster generator] (JHipster Gateway + UAA + 2 microservices + consul[0.9.3]). Postgres as database and Hazelcast is enabled in project. My aim was to test the rate-limiting feature. Using 'dev' profile, rate limit is working fine in JHipster, I've tested it successfully, without any exceptions. Now I'm testing it with 'prod' profile. I've enabled rate-limiting in application-prod.yml, added limit + duration-in-seconds(as in application-dev.yml):
But while running (tried in intellij with prod profile, tried on command line with -Pprod, also tried with docker-compose with prod profile), it throws following exception:
Reproduce the error
Yes it is highly reproducible. I however have noticed that sometimes when i kill the gateway (when the services are up) and start it again, calls start working [but not always]. It seems to me that there is some kind of race condition. Issue might be between Hazelcast and bucket4j.
Related issues
Not sure but may be related with hazelcast message serialization which does not find the bucket4j class which is probably in a different class loader?
hazelcast/hazelcast#8972???
I've also created a stackoverflow issue before creating this one: https://stackoverflow.com/questions/48976687/jhipsterconsul-rate-limit-with-prod-profile-throwing-classnotfound-exception
Suggest a Fix
JHipster Version(s)
JHipster 4.14.0
JHipster configuration
zuul based gateway+uaa+2 microservices, all of them using POSTGRES, + consul 0.9.3
Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryBrowsers and Operating System
Ubuntu 16.4 , Chrome
The text was updated successfully, but these errors were encountered: