Implementing Oracle Coherence with SOA Suite 12c

In continuation of my previous post "Oracle Coherence with SOA Suite 12c- Useful Links" finally I am writing this post to describe the way I have done the implementation of Oracle Coherence with SOA Suite 12c.

Environment 

Operating SystemWindows 10, x64
Oracle SOA Suite Version12.1.3.0
Oracle Coherence Version12.1.3.0
JDeveloper Version12.1.3.0
WebLogic ServerIntegrated Weblogic with Jdev & SOA Suite
Implementation MethodologyThrough Coherence Adapter
Services DeploymentSOA Server

Coherence cache acts like a store where we can put database data and made it available for different application, Coherence cache serves as an intermediary between the database and client application. Below diagram shows the high-level overview of the same-
In order to achieve the functionality of data caching with Oracle SOA Suite using Coherence adapter in the current environment, there are certain steps needed to be executed in order. Steps specified below have been used for first SOA Project ‘AboutUs’ -
    1. Configure Coherence Adapter in SOA Suite 12c
    2. Create a new JNDI for coherence
    3. Update the project- AboutUs
    4. Testing of Coherence enabled service
Below are the details of the steps involved in it-

A. Configure Coherence Adapter in SOA Suite 12c
Just to give idea about Coherence adapter in Oracle SOA Suite 12c is that it is bundled with it. We can perform below operations with Coherence adapter-
    1. PUT
    2. GET
    3. REMOVE
    4. QUERY
Coherence Adapter is available under deployments inside WebLogic Console. However, it is in a disabled state by default so we have to enable it in order to use.
Click on Coherence adapter and go to Targets tab. Choose DefaultServer  Or if there is a cluster then select accordingly as a target and save it.

You will see Coherence adapter is in the active state now.


Coherence adapter under WebLogic console is ready to use.


B. Create a new JNDI for Coherence

We have three default JNDI’s for Coherence adapter.

    1. eis/Coherence/Local
    2. eis/Coherence/Remote
    3. eis/Coherence/XALocal
    4. eis/Coherence/Local
Before we go for creation of custom JNDI for coherence, we need custom cache configuration file. So below cache configuration has been created for the same-
Now we’ll create a custom cache configuration file to be used in our project.
    1. Go to WebLogic Console
    2. Now to check the cache name, click on the JNDI which we used. To go to that JNDI, first open admin console; 
    3. Go to Deployments -> CoherenceAdapter -> Configuration -> Outbound Connection Pool.
    4. Click on the first JNDI. You see one cache configuration file location there. Go to that location and open that file. You see cache name is mentioned there. Just click on it and update the data as specified below.
    5. Just make sure, your Service Name matches as specified in cache configuration file
    6. Save it and update the adapter.
Now we are done for prerequisite configuration and ready to update our SOA project.


C. Update the existing SOA Project
Now we’ll open the existing project and will modify it for coherence implementation in it. We will configure Coherence adapter for Put and Get operations. Below are the steps for the changes being done in AboutUs SOA composite.
  • Open the AboutUS composite.
  • Drag Coherence adapter to the composite pane and name it – Put_Cache
  • Now choose the Coherence JNDI, there is three types of JNDI Local, Remote and XALocal, since we are connecting to local Coherence cache so we choose Concor Coherence JNDI.
  • Below are the next steps to be done in configuration part for PUT operation.
  • Similarly, configure Coherence adapter for GET operation
  • Next, do the wiring of BPEL process with GET & PUT operations of Coherence adapter.
  • Now your composite will look like-
  • Now do the necessary changes for GET & PUT operations and most important both operations will use the property jca.coherence.key for reading/writing data in the cache. So do configure it as specified below for GET operation invocation. 
  • Now it’s time to do orchestration inside BPEL process.
  • In the above screenshot, first we check data from the cache, if found then assign it to output from cache otherwise do get from db, then write it to cache.
  • Now save the composite, deploy it on integrated WebLogic Server.
  • Go to enterprise manager to test it.
D. Testing of Coherence enable service
Now at this point, we are ready to test the revised and Coherence enabled SOA based REST service through enterprise manager.

Test Case-1
Since the service is accepting GET requests so, we’ll do a test now-
  • Login to EM and navigate to project under SOA.
  • Provide sample value in input- ‘concor’. Currently, we’ll use this as a key else ‘default’ in case of no input.
Check the audit trail of respective service invocation and carefully see the elapsed time for individual components-

Test Case-2
Check the audit trail of respective service invocation and carefully see the elapsed time for individual components this time once again-

Conclusion
The audit trail can be checked from both scenarios that the test2 run has data retrieved from the cache instead of the database. If we check audit trail for test1 where cache check is done and the cache is not available hence data is retrieved from the database and written to the cache.  
By detailed examination, it can be seen in the audit trail that the time difference in service invocation for both of the cases. Coherence has improved the overall performance of the service call.


Comments

  1. It is very good blog and useful for students

    Oracle SOA Online Course

    ReplyDelete

  2. Thanks for sharing this great information I am impressed by the information that you have on this blog. Same as your blog i found another one Oracle SOA Training
    . Actually, I was looking for the same information on internet for Oracle SOA Interview Questions and Answers

    and came across your blog. I am impressed by the information that you have on this blog. It shows how well you understand this subject, you can learn more about Oracle SOA Tutorial also.

    ReplyDelete
  3. This comment has been removed by a blog administrator.

    ReplyDelete

Post a Comment

Popular posts from this blog

Oracle SOA Suite- Implementing Email Notification

Oracle SOA Suite 12c- PKIX path building failed & unable to find valid certification path to requested target

Migration of Oracle SOA Suite Composite from 11g to 12c