Platform Framework
R24 AMR | Min(s) read

Setting up Oracle Weblogic Coherence

This section describes a GAR file that is deployed to Weblogic for Coherence configuration.

Completing the Prerequisite Tasks

To complete the prerequisite tasks,

  1. Set up the proxy for pure java clients (non application server clients) in the TAFJCache.gar file.
    The TAFJCache.gar file can be found in $TAFJ_HOME/appserver/weblogic.
  2. Change localhost to the IP address of the server.

    <!-- One or more proxy schemes defined for client connections. Change address for each server.

    See https://docs.oracle.com/cd/E18686_01/coh.37/e18678/gs_configextend.htm#COHCG5021 for more info

    -->

    <proxy-scheme>

    <service-name>ExtendTcpProxyService</service-name>

    <acceptor-config>

    <tcp-acceptor>

    <local-address>

    <address>localhost</address>

    <port>9099</port>

    </local-address>

    </tcp-acceptor>

    </acceptor-config>

    <proxy-config>

    <cache-service-proxy>

    <enabled>true</enabled>

    <lock-enabled>true</lock-enabled>

    </cache-service-proxy>

    <invocation-service-proxy>

    <enabled>true</enabled>

    </invocation-service-proxy>

    </proxy-config>

    <autostart>true</autostart>

    </proxy-scheme>

Setting up Oracle Coherence for Standalone Clients

To setup oracle coherence for standalone clients,

  1. Uncomment the following line in tafj_conf.bat (sh) to set up the JVM properties. This is done for the clients who run pure java client programs such as tRun with Coherence clusters inside or outside of WebLogic.

    rem # If using oracle coherence

    export "JAVA_OPTS=$JAVA_OPTS -Dcoherence.cacheconfig=tafj-cache-config-client.xml -Dcoherence.jcache.configuration.classname=passthrough -Dcoherence.log=log4j -Dcoherence.log.level=1"

  2. Set the following properties in $TAFJ_HOME/conf/cache/tafj-cache-config-client.xml and change the localhost to the IP address of the server.

    <!-- remote-scheme for Coherence client connections (Weblogic Coherence must be running). Change address from localhost to IP of server.

    See https://docs.oracle.com/cd/E18686_01/coh.37/e18678/gs_configextend.htm#COHCG5021 for more info

    -->

    <remote-cache-scheme>

    <scheme-name>extend-remote</scheme-name>

    <service-name>ExtendTcpProxyService</service-name>

    <initiator-config>

    <tcp-initiator>

    <remote-addresses>

    <socket-address>

    <address>localhost</address>

    <port>9099</port>

    </socket-address>

    </remote-addresses>

    </tcp-initiator>

    <outgoing-message-handler>

    <request-timeout>5s</request-timeout>

    </outgoing-message-handler>

    </initiator-config>

    </remote-cache-scheme>

Oracle Coherence setup for All Clients

The value in CACHENAME for the particular table matches to a defined cache setup in Oracle Coherence. For standalone mode (not in a WebLogic application server), the cache names must match with the definition that are available in $TAFJ_HOME/conf/cache/tafj-cache-config-client.xml.

If you target Coherence within WebLogic, then cache names must match with the definition that are available in the TAFJCache.gar file.

In the example below, Tables is the cache name used in the CACHENAME column. This matches the definition found in tafj-cache-config.xml. These definitions must match or the cache will not be found.

<?xml version="1.0"?>

<!-- This cache configuration file is for the storage enabled and disabled

members in the Managed Coherence Server example. -->

<cache-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns="http://xmlns.oracle.com/coherence/coherence-cache-config"

xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-cache-config coherence-cache-config.xsd">

<defaults>

<scope-name>TAFJCache</scope-name>

</defaults>

<caching-scheme-mapping>

<cache-mapping>

<cache-name>Tables</cache-name>

<scheme-name> extend-remote </scheme-name>

</cache-mapping>

</caching-scheme-mapping>

The <scheme-name> maps to an Oracle cache configuration within the same tafj-cache-config-client.xml file. In the above example, extend-remote refers to a caching scheme on the Coherence server. This scheme was shown earlier in Setting up Oracle Coherence for Standalone Clients inside the <remote-cache-scheme> tag.

Once the table matches within TAFJ (comparing the <cache-name> element against the CACHENAME column in the TAFJ_CACHE table), caching on that table will begin across a cluster. Writes on cached data delete the element from the cache, and keys must be re-read. If a node in the cluster is shutdown, its elements will also be removed from the cache (if the data is not using a replicated scheme), and the data will have to be re-read by other nodes. Using replicated data does incur a performance cost especially with writing to caches, so make sure on what scheme you want to use.

This user guide does not cover Coherence cache setup. For more information, see the link.

You must be very careful not to exceed the memory assigned and must setup the appropriate expiry times for data to be refreshed. Also, when data is being written within Temenos Transact for a particular record, the record is cached and the cache is emptied of that key so that subsequent reads shall get fresh data.

Logging Coherence

This section shows you how to get the Coherence logs.

In standalone mode, set the following properties in $TAFJ_HOME/bin/tafj_conf.bat (sh) so that Coherence logs to the COHERENCE appender in TAFJTrace.properties.

-Dcoherence.log=log4j -Dcoherence.log.level=1

Appender in TAFJTrace.properties:

log4j.logger.Coherence=INFO, coherence

If you want maximum logging, then set coherence.log.level=9.

Deploying the TAFJ.gar file

You can deploy the TAFJCache.gar file as a library and reference it within the TAFJJEE_EAR.ear file, but this approach raises reloading issues. This section shows you how to avoid these reloading issues.

To avoid the reloading issues,

  1. Add the following configuration in the weblogic-application.xml file to deploy TAFJCache.gar in the TAFJJEE_EAR.ear file.

    <module>

    <name>TAFJCache</name>

    <type>GAR</type>

    <path>TAFJCache.gar</path>

    </module>

  2. Configure TAFJCache.gar at the root level of the TAFJJEE_EAR.ear file.

Running Coherence in Standalone Mode

This section highlights the rules and steps that are required to run Coherence in standalone mode.

Monitoring Coherence

See the instructional video by Oracle on how to monitor Coherence caches through jVisualVM.

Copyright © 2020- Temenos Headquarters SA

Published on :
Monday, May 27, 2024 5:03:10 PM IST