Configure ehcache

The ehcache is an open source Java distributed cache for caching, Java EE, and light-weight containers. Every node in the cluster can use the same campaign_ehcache.xml file or you can set a different campaign_ehcache.xml file for each node. For installations in a cluster, edit the campaign_ehcache.xml file so you do not have to restart the computer if you change any templates or offer folders.

Important:
  • If your installation is upgraded from a previous version, the campaign_ehcache.xml file is overwritten. Add and edit the following sections in the file.
  • You must also configure caching for user sessions (userSessionCache).

Use one of the following procedures to configure the ehcache file.

Configuring ehcache with Remote Method Invocation (RMI)

Unica Campaign systems that have the following topography typically use RMI:


Server with load balancing across two servers

Go to the <HCL_Unica_HOME>\<CAMPAIGN_HOME>\conf directory and open the campaign_ehcache.xml file in a text editor. Then, make the following edits:

  • Uncomment the following section of the file.

    You must customize the settings for machineA and machineB to reflect your environment. Provide a pipe-separated list of all servers in the cluster and use fully qualified host names.

    <!--<cacheManagerPeerProviderFactory 
    class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory" 
    properties="peerDiscovery=manual, rmiUrls=//
    <machineA>:40000/campaignApplicationCache|//
    <machineB>:40000/campaignApplicationCache|//
    <machineA>:40000/userSessionCache|//
    <machineB>:40000/userSessionCache"/>
    <machineA>:40000/mappingCache
    <machineA>:40000/multipartitionOptSessionRunStatusCache
    <machineA>:40000/optSessionUserSessionCache
    -->
  • Uncomment the following section of the file.
    <!--
    <cacheEventListenerFactory
    class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
    properties="replicateAsynchronously=true, replicatePuts=true,
    replicateUpdates=true, replicateUpdatesViaCopy=true,
    replicateRemovals=true"/>
    <cacheEventListenerFactory
    class="com.unicacorp.Campaign.cache.CampaignCacheEventListenerFactory" />
    <machineA>:40000/mappingCache
    <machineA>:40000/multipartitionOptSessionRunStatusCache
    <machineA>:40000/optSessionUserSessionCache
    
    -->
  • Uncomment the following section of the file.
    <!--
    <cacheEventListenerFactory
    class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
    properties="replicateAsynchronously=true, replicatePuts=true,
    replicateUpdates=true, replicateUpdatesViaCopy=true, 
    replicateRemovals=true"/>
    -->

Configuring ehcache with multicast

Unica Campaign systems that have the following topography typically use multicast:


Server with load balancing over one server

Go to the <UNICA_HOME>\<CAMPAIGN_HOME>\conf directory and open the campaign_ehcache.xml file in a text editor. Then, make the following edits:

  • Uncomment the following section of the file.

    You must customize the settings for multicastGroupAddress and multicastGroupPort to reflect your environment.

    <!--<cacheManagerPeerProviderFactory 
    class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory" 
    properties="peerDiscovery=automatic, multicastGroupAddress=230.0.0.1, 
    multicastGroupPort=4446, timeToLive=32"/>
    
    <cacheManagerPeerListenerFactory 
    class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"/>
    -->
  • Uncomment the following section of the file.
    <!--
    <cacheEventListenerFactory
    class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
    properties="replicateAsynchronously=true, replicatePuts=true,
    replicateUpdates=true, replicateUpdatesViaCopy=true,
    replicateRemovals=true"/>
    <cacheEventListenerFactory
    class="com.unicacorp.Campaign.cache.CampaignCacheEventListenerFactory" />
    -->