I would like to cluster a map that is kept on application-level scope.
A first thought was to use a @Singleton
, @Clustered
bean with a field holding my data.
This does not seem to work and my guess is that it was never implemented
This post proposes ways to implement clustered singletons but they seem complex.
The only alternative that I see, apart from manually updating db table(s), is to use a replicated cache.
My question is: Is it advised to declare and use an infinispan cache (like this) for solving this problem?
If yes, what settings should I use to avoid dirty reads?
Is there any other option to this relatively simple problem in the era of wildfly-18?
As you mentioned a cluster, you need to use
standalone-full-ha.xml
Edit the file and add the following configuration
You have different caches available for your application, if you wish use a replicated cache, you can inject it in your app with