EHCache: checking cache equivalence in the JVM

I have a working proof of the concept of the JMS EHcaches replication topology using Websphere MQ.

To explain a little how this works, 2 JVMs work for me. When JVM1 calls the EHCache put method, the item is cached, which is then replicated to JVM2 (which is done through the EHCache configuration).

According to the EhCache documentation, the JMS replication topology is considered “weak consistency”, that is, there may be a problem with every JVM node cache that matches the latter.

Does anyone know how I can compare two JVMs (cache nodes) to ensure that they contain equivalent Cache objects and all cache elements inside?

+4
source share
1 answer

It looks like you identified the problem in a rather complicated way. Try to simplify a bit:

  • First of all, you have something like distributed Map, so there is no need to compare JVMs or cache nodes.
  • Secondly, you are developing a way to test / test your installation, so you can use predefined data.

Let's say we have two cache nodes, and some Replication magic(provided by Ehcache in your case):

enter image description here

We can also generate some test data (a set of pairs key:value). Thus, the easiest way to test Replication magicis to import our data into Node 1and develop a very simple monitoring tool "Node 2".

: , Node 2, . , ​​ , .., .

, , . ( , ):

enter image description here

, , , , .

, , . , :

  • Node 1
  • Node 2.
  • , .

(, ):

enter image description here

, , .

.

+3

All Articles