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.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…