Search This Blog

Monday, April 03, 2017

OSB result Caching support in 11g with external coherence

OSB result Caching support in 11g with external coherence
OSB result Caching support in 11g




Created a simple SOA project with the simple helloworld that displays time+the input parameter you have passed.


for example

concat(xp20:current-dateTime(),bpws:getVariableData('inputVariable','payload','/client:process/client:input'))


Create a OSB project that calls this web service and enable the result cahcing for the business service.
Take this WSDL and import this to OSB and create a business service with this WSDL.

OSB Project 



Create a proxy service based on the business service.

Modify the file

\fmw11g\fmw1117\Middleware\user_projects\domains\soa_domain\config\osb\coherence\osb-coherence-override.xml
======================================================================================================================



<!DOCTYPE coherence SYSTEM "coherence.dtd">
<coherence>
    <cluster-config>
        <!--
            By specifying a well-known-address we disable the mutlicast listener.
            This ensures that the Coherence cluster for OSB will be isolated to this machine only.
        -->
        <unicast-listener>
            <well-known-addresses>
                <socket-address id="1">
                    <address system-property="OSB.coherence.wka1">xxx.xxx.oracle.com</address>
                    <port system-property="OSB.coherence.wka1.port">7890</port>
                </socket-address>
                <socket-address id="2">
                    <address system-property="OSB.coherence.wka2">xxx.xxx.oracle.com</address>
                    <port system-property="OSB.coherence.wka2.port">7898</port>
                </socket-address>
            </well-known-addresses>
            <address system-property="OSB.coherence.localhost">xxx.xxx.oracle.com</address>
            <port system-property="OSB.coherence.localport">7890</port>
        </unicast-listener>
        <multicast-listener>
            <time-to-live system-property="OSB.coherence.ttl">0</time-to-live>
        </multicast-listener>
    </cluster-config>
</coherence>

+++++++++++++

Where
 <socket-address id="1">
                    <address system-property="OSB.coherence.wka1">xxx.xxx.oracle.com</address>
                    <port system-property="OSB.coherence.wka1.port">7890</port>
                </socket-address>

Is for the stand alone Coherence server

<socket-address id="2">
                    <address system-property="OSB.coherence.wka2">xxx.xxx.oracle.com</address>
                    <port system-property="OSB.coherence.wka2.port">7898</port>
                </socket-address>

Is for the OSB Server

No need to change the file
\\soabde11\fmw11g\fmw1117\Middleware\user_projects\domains\soa_domain\config\osb\coherence\osb-coherence-cache-config.xml

Once it is done , open the setDomainEnv.sh file

EXTRA_JAVA_PROPERTIES="${EXTRA_JAVA_PROPERTIES} -Dsoa.archives.dir=${SOA_ORACLE_HOME}/soa -Dsoa.oracle.home=${SOA_ORACLE_HOME} -Dsoa.instance.home=${DOMAIN_HOME} -Dtangosol.coherence.distributed.localstorage=false -DOSB.coherence.localhost=xxx.xxx.oracle.com -DOSB.coherence.localport=7898 -Dtangosol.coherence.wka1=xxx.xxx.oracle.com -Dtangosol.coherence.wka2=xxx.xxx.oracle.com  -Dtangosol.coherence.wka1.port=7898 -Dtangosol.coherence.wka2.port=7890 -Dtangosol.coherence.log=jdk -Djavax.xml.soap.MessageFactory=oracle.j2ee.ws.saaj.soap.MessageFactoryImpl -Dweblogic.transaction.blocking.commit=true -Dweblogic.transaction.blocking.rollback=true -Djavax.net.ssl.trustStore=${WL_HOME}/server/lib/DemoTrust.jks"

The default entries are

#EXTRA_JAVA_PROPERTIES="${EXTRA_JAVA_PROPERTIES} -Dsoa.archives.dir=${SOA_ORACLE_HOME}/soa -Dsoa.oracle.home=${SOA_ORACLE_HOME} -Dsoa.instance.home=${DOMAIN_HOME} -Dtangosol.coherence.clusteraddress=227.7.7.9 -Dtangosol.coherence.clusterport=9778 -Dtangosol.coherence.log=jdk -Djavax.xml.soap.MessageFactory=oracle.j2ee.ws.saaj.soap.MessageFactoryImpl -Dweblogic.transaction.blocking.commit=true -Dweblogic.transaction.blocking.rollback=true -Djavax.net.ssl.trustStore=${WL_HOME}/server/lib/DemoTrust.jks"

basically you need to remove
-Dtangosol.coherence.clusteraddress=227.7.7.9 -Dtangosol.coherence.clusterport=9778
and replace this with
-Dtangosol.coherence.distributed.localstorage=false -DOSB.coherence.localhost=xxx.xxx.oracle.com -DOSB.coherence.localport=7898 -Dtangosol.coherence.wka1=xxx.xxx.oracle.com -Dtangosol.coherence.wka2=xxx.xxx.oracle.com  -Dtangosol.coherence.wka1.port=7898 -Dtangosol.coherence.wka2.port=7890


Create a shell script to start the Coherence server

+++++

#!/bin/sh

# Change below to appropriate location
JAVA_HOME="/home/oracle/jdk1.7.0_67"
WLS_HOME="/fmw11g/fmw1117/Middleware"
COHERENCE_HOME="${WLS_HOME}/coherence_3.7/"
OSB_ORACLE_HOME="${WLS_HOME}/Oracle_OSB1"
OSB_COHERENCE_CONFIG="${WLS_HOME}/user_projects/domains/soa_domain/config/osb/coherence"

NEW_SIZE=2048m
HEAP_SIZE=4096m

NODE_NAME="CacheServer"

# Change below to appropriate ip address and port
LOCAL_HOST="xxx.xxx.oracle.com"
LOCAL_PORT="9094"

JAVA_OPTS="-Xloggc:gc_${NODE_NAME}.log -server -XX:NewSize=${NEW_SIZE} -XX:MaxNewSize=${NEW_SIZE} -Xms${HEAP_SIZE} -Xmx${HEAP_SIZE} -XX:PermSize=128m -XX:MaxPermSize=128m -verbose:gc -XX:+PrintGCDateStamps -XX:+PrintGCDetails"

JMXPROPERTIES="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dtangosol.coherence.management=all -Dtangosol.coherence.management.remote=true "

COHERENCE_OPTS="-Dtangosol.coherence.distributed.localstorage=true -Dtangosol.coherence.override=${OSB_COHERENCE_CONFIG}/osb-coherence-override.xml -Dtangosol.coherence.cacheconfig=${OSB_COHERENCE_CONFIG}/osb-coherence-cache-config.xml -Dtangosol.coherence.log.level=9 -Dtangosol.coherence.cluster=OSB-cluster -Dtangosol.coherence.localhost=${LOCAL_HOST} -Dtangosol.coherence.localport=${LOCAL_PORT}"

CLASSPATH="$COHERENCE_HOME/lib/coherence.jar:$OSB_ORACLE_HOME/lib/osb-coherence-client.jar"

$JAVA_HOME/bin/java -server -showversion $JAVA_OPTS $COHERENCE_OPTS $JMXPROPERTIES -cp "$CLASSPATH" com.tangosol.net.DefaultCacheServer $1

+++++

First start the coherence server using the script
c1.sh

and after this start the OSB Server.





Tags: Publish
April 03, 2017 at 02:22PM
Open in Evernote

No comments: