Saturday, December 31, 2016

Eclipselink Cache Coordination with JBoss and JMS

Agenda:
  1. Creating JPA project and generating entities.
  2. Configuring persistence properties and JPA project
  3. Testing the JPA project
  4. Update database when entity changed.
  5. Setting up load balance database connection.
  6. Setting Cache Coordination in Eclipselink

Cache Coordination enables EclipseLink to synchronize data changes in a distributed environment. for more information about cache coordination in EclipseLink, click here.

Following are the steps to enable Cache Coordination in JBoss AS7 / JBoss EAP6.
1. create JMS topic

2. creaet JMS connection factory

3. add the cache coordination properties into persistence.xml
<property name="eclipselink.cache.coordination.protocol" value="jms" />

<property name="eclipselink.cache.coordination.jms.topic" value="jms/EclipseLinkTopic" />

<property name="eclipselink.cache.coordination.jms.factory" value="jms/EclipseLinkTopicConnectionFactory" />

<property name="eclipselink.cache.coordination.jms.reuse-topic-publisher" value="true" />

<property name="eclipselink.cache.coordination.jms.host" value="remote://HOST:PORT" />

4. in eclipseLink module.xml, add the following into <dependencies />
<module name="javax.jms.api"/>

5. in hornetq module.xml, add the following into <dependencies />
<module name="org.eclipse.persistence"/>



Done!!

LinkWithin

Related Posts Plugin for WordPress, Blogger...