Search This Blog

Monday, September 17, 2018

coherence adapter to work with external remote cache

coherence adapter to work with external remote cache
I have followed the exact steps given in the URL below to make the coherence adapter to work with external remote cache


1. create a file

example-config.xml

++
<?xml version="1.0"?>
<!DOCTYPE cache-config SYSTEM "cache-config.dtd">
<cache-config>
  <caching-scheme-mapping>
     <cache-mapping>
        <cache-name>dist-extend</cache-name>
        <scheme-name>extend</scheme-name>
     </cache-mapping>
  </caching-scheme-mapping>

  <caching-schemes>
     <distributed-scheme>
        <scheme-name>extend</scheme-name>
        <lease-granularity>member</lease-granularity>
        <backing-map-scheme>
           <local-scheme/>
        </backing-map-scheme>
        <autostart>true</autostart>
     </distributed-scheme>

     <proxy-scheme>
        <service-name>ExtendTcpProxyService</service-name>
        <thread-count>5</thread-count>
        <acceptor-config>
           <tcp-acceptor>
              <local-address>
                 <address>localhost</address>
                 <port>9099</port>
              </local-address>
           </tcp-acceptor>
        </acceptor-config>
        <autostart>true</autostart>
     </proxy-scheme>
  </caching-schemes>
</cache-config>
++

2. Create a file

extend-config.xml

++

<?xml version="1.0"?>
<!DOCTYPE cache-config SYSTEM "cache-config.dtd">

<cache-config>
 <caching-scheme-mapping>
   <cache-mapping>
     <cache-name>dist-extend</cache-name>
     <scheme-name>remote</scheme-name>
   </cache-mapping>
 </caching-scheme-mapping>

 <caching-schemes>
   <remote-cache-scheme>
     <scheme-name>remote</scheme-name>
     <service-name>ExtendTcpCacheService</service-name>
     <initiator-config>
       <tcp-initiator>
         <remote-addresses>
           <socket-address>
             <address>localhost</address>
             <port>9099</port>
           </socket-address>
         </remote-addresses>
         <connect-timeout>10s</connect-timeout>
       </tcp-initiator>
       <outgoing-message-handler>
         <request-timeout>5s</request-timeout>
       </outgoing-message-handler>
     </initiator-config>
   </remote-cache-scheme>

   <remote-invocation-scheme>
     <scheme-name>extend-invocation</scheme-name>
     <service-name>ExtendTcpInvocationService</service-name>
     <initiator-config>
       <tcp-initiator>
         <remote-addresses>
           <socket-address>
             <address>localhost</address>
             <port>9099</port>
           </socket-address>
         </remote-addresses>
         <connect-timeout>10s</connect-timeout>
       </tcp-initiator>
       <outgoing-message-handler>
         <request-timeout>5s</request-timeout>
       </outgoing-message-handler>
     </initiator-config>
   </remote-invocation-scheme>
 </caching-schemes>
</cache-config>

++

3. Run the external coherence server using the command

java -cp /fmw11g/soa12212/coherence/lib/coherence.jar:. -Dtangosol.coherence.cacheconfig=example-config.xml com.tangosol.net.DefaultCacheServer

4. Modify the Outbound Connection Pool Configuration Table for
eis/Coherence/Remote

with the following

CacheConfigLocation java.lang.String /home/oracle/extend-config.xml
ClassLoaderMode java.lang.String CUSTOM
ConnectionFactoryLocation java.lang.String <blank>
PojoJarFile java.lang.String <blank>
ServiceName java.lang.String  <blank>
WLSExtendProxy java.lang.Boolean false

Here blank means no value.

5. Deploy the SOA Project ,
extract the project Cohe1.zip and deploy the coherence soa project.

Refer to the uploaded file Cohe1.zip



6. Run the BPELProcess1 with the input as say TEST1234567890 ,
on successful execution this creates a cache entry with the key as test1 and value as "TEST1234567890".

Check the flow trace , if everything goes well this you should see no error's.

Now run BPELProcess2 , give input as any random value , this reads coherence with the key name as "test1" and get's the value for the key "test1".
Successful execution should give the result as "TEST1234567890"





Tags: Publish
September 17, 2018 at 04:09PM
Open in Evernote

1 comment:

Blog27999 said...

If you're trying hard to lose kilograms then you certainly need to try this totally brand new custom keto plan.

To create this service, licensed nutritionists, fitness trainers, and top chefs have united to develop keto meal plans that are effective, painless, price-efficient, and satisfying.

From their first launch in January 2019, thousands of people have already completely transformed their body and well-being with the benefits a proper keto plan can provide.

Speaking of benefits: in this link, you'll discover 8 scientifically-proven ones provided by the keto plan.