Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
557 views
in Technique[技术] by (71.8m points)

spring - jhipster - JPA - Hibernate - CacheMemory - Hazelcast- in Distributed environment -

We are building an application using Jhipster with spring boot microservice architecture, and want to deploy sample application in multiple VMs to have load balancer in jhipster registry. For easy reference, I name my application as 'Spidy'. So, war file of Spidy app is installed in two VMs - 'lpqrstv1' and 'lpqrstv2', and this 'Spidy' app will talk to database. By default jhipster gave us 'HazelCast' 2nd level cache and we are ok with that.

Now, if a CRUD operation is performed from 'lpqrstv1',Hazelcast cache on this server is updated and DB is successfully updated, but Hazelcast cache on 'lpqrstv2' is not refreshed. And so, when UI is doing read operation, and if load balancer routes read request to 'lpqrstv2', we are getting stale data as long corresponding data exists in hazelcast of 'lpqrstv2'

I want to know, how to implement to refresh both caches with any CUD operation.

Any help in this regard is greatly appreciated.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...