Call Java code for Application Server cluster nodes

Say I have a Java Webapp deployed on some kind of application server with clustering on multiple nodes.

In webapp, we store a cache of some values ​​obtained from the database, stored in memory as static variables. Whenever the user performs an update on a particular screen, we clear the cache so that the cached values ​​are retrieved again the next time they are needed.

Now the problem is: since each node in the cluster runs on a separate JVM, how can I clear the cache for all nodes? Basically I want to call a static function for each node cluster. Is there some standard J2EE way to do this, or does it depend on the application server software?

+3
source share
1 answer

On a "standard" application server such as Jboss, you can use JMX or Message Beans to do this.

+1
source

Source: https://habr.com/ru/post/1715156/


All Articles