Usage of Coherence Adapter in SOA 12c
Scenario: Taking an input and checking whether the record available in
Cache by doing
Get operation on
Coherence Adapter, if available we are using that record and proceeding further
, If not available
getting the data from
database by
Select operation on
DB Adapter and putting the same record in
Cache by using
Put operation on Coherence Adapter
.
1) Creating a composite with name
CoherenceAdapter with BPEL template as
One Way.
2) Configuring
Coherence Adapter with
Get Operation.
Selecting JNDI as
eis/Coherence/Local
Selecting Get Operation
Selecting Cache Name as
adapter-local because
Cache Configuration File is configured with this name as shown below.
Click Next and Click OK
Click Next
Click Finish
3) Configuring
DB Adapter with
Select Operation.
Select Database and JNDI
Tick Select Operation
Select the table created
Select the Primary Key of the table
Add the parameter and create the SQL Query based on the parameter
4) Configuring
Coherence Adapter using
Put Operation.
Select the JNDI
Select Put Operation
Create a variable (
CoherenceKey)
Assign the
Input to this variable (
CoherenceKey)
Add an Invoke to invoke the
getDataFromCoherence PartnerLink
Double click on the
Invoke --> Properties --> select
jca.coherence.key as name and browse for the created variable
CoherenceKey
Checking the condition if data coming from Get Coherence. If coming Do Nothing.
If Data Not Coming Get the data from database and Put the same in Coherence as shown below.
Getting the data from database by passing the Input
Putting the record in the Coherence Cache
Final BPEL looks like below
Thank You!!!!
Happy Learning!!!!