Search code examples
jpacachingeclipselinkpayara

Setup eclipselink cache coordination in Payara


I'm using payara 5.201. I have two instances running in docker in the same network. Payara uses eclipselink 2.7.4.

I used the settings as described here.

I enabled and started the hazelcast grid in both payara instances.

I created a rest resource which can get and update data in an entity.

When I set some value in instance one I expect the get on instance two to show the same information but it doesn't.

What am I doing wrong?

See here for a test project that you can run/debug.


Solution

  • The problem is fixed, the issue was that the hazelcast discovery mode is 'domain' by default in payara server (it is multicast in payara-micro) which makes sense because usually a payara cluster is used.

    But in my case there is no cluster but simply two payara (DAS) instances. So setting the hazelcast cluster mode to multicast solved the problem.

    This works in this case because both docker instances are started using docker-compose and share the same network so multicast works.

    I updated the github repo. Check it out.