Tuesday 30 September 2014

AQ Adapter Implementation in SOA 12C

Oracle Streams Advanced Queuing (AQ) provides a flexible mechanism for bidirectional, asynchronous communication between participating applications. Advanced queues are an Oracle database feature, and are therefore scalable and reliable


UseCase:- In this usecase, we will try to dequeue message from Request AQ through BPEL and insert in Response AQ
  1.   First of all, we need to create AQ’s on the database , then will start developing SOA composite. In order to create Request AQ, use below script:- 
Create user Demo identified by oracle;  
GRANT CONNECT,RESOURCE,DBA TO Demo;
grant EXECUTE ON DBMS_AQ to Demo;

CREATE OR REPLACE type Demo.REQ_AQ_TABLE_TYP as object(
ORDERID NUMBER,
 orderedQty VARCHAR2(100),
 status VARCHAR2(100)
);

EXECUTE DBMS_AQADM.CREATE_QUEUE_TABLE ('Demo.REQ_aq_table','Demo.REQ_aq_table_typ');
EXECUTE DBMS_AQADM.CREATE_QUEUE ('Demo.REQ_aq','Demo.REQ_aq_table');
EXECUTE DBMS_AQADM.START_QUEUE ('Demo.REQ_aq');

grant all privileges on Demo.REQ_AQ_TABLE_TYP to Demo;

After executing above script, we can confirm it from database:-


Similarly Create Response Queue by executing below script:-
create type Demo.RESP_AQ_TABLE_TYP as object(
ORDERNumber NUMBER,
 orderedQty VARCHAR2(100)
 );

EXECUTE DBMS_AQADM.CREATE_QUEUE_TABLE ('Demo.RESP_aq_table','Demo.RESP_aq_table_typ');

EXECUTE DBMS_AQADM.CREATE_QUEUE ('Demo.RESP_aq','Demo.RESP_aq_table');

EXECUTE DBMS_AQADM.START_QUEUE ('Demo.RESP_aq');

grant all privileges on Demo.RESP_AQ_TABLE_TYP to Demo;


2.) Create a new SOA project and name it as ‘AQDemo’



3.) Drag and drop AQ Adapter from Components Pallet to the Left hand lane i.e ‘Exposed Service’ of the design view of composite.xml[AQDemo.xml]
  •    Give name as ‘AQPollingService’  and click next






4.)Click on '+' sign to add new database connection if it doesn't exist ,  else select Database Connection from drop down . Enter the Database details and click OK.


5.)After selecting the connection, Enter the JNDI name Example:- 'eis/AQ/Demo_DB'. If someone wants to   use existing  JNDI on server, then select it by clicking search button on right side. It will open a popup and we can select the JNDI from that wizard.



6.)Choose 'Define From Operation and schema'  option and click next



7.)Choose 'Dequeue' operation as we want to poll message from Req AQ

 
8.)Select Database Schema from Drop down. It is 'Demo'  on our case. Then Choose Queue Name by Clicking on Browse Button. then click next.


9.)  If someone wants to set ‘Correlation ID’ or ‘Dequeue Condition’ then set it on below wizard. Otherwise go  with empty values and click next




10.)    Select the option ‘Whole Object REQ_AQ_TABLE_TYP’ and click next

11.)Click Finish



12.) Similarly create one more AQ Adapter for Enqueuing the message in Resp queue which is ‘RESP_AQ’ in our case.
Drag and drop AQ Adapter from Components Pallet to the Right hand lane i.e ‘External References’ of the design view of composite.xml[AQDemo.xml] 
Repeat the steps mentioned above for creating Req Queue.

                           I.          Give the name of service as ‘AQInsertService’.
                         II.          After Reaching step  4 of Configuration wizard, select operation as ‘Enqueue’ and click next. 


             III. On step 5, Choose the database Schema & Queue Name of Response queue as below.




13.) Create one-way BPEL Process ‘AQDemo’ and connect it with AQAdapters through wires as below:-


14.)Before Deployment of SOA Composite, we need to Configure JNDI of connection Pool which was mentioned while creating AQ adapters.

Go to http://<hostname>:<port>/console 
                           a.          Go to Deployments -> AqAdapter -> Configuration -> Outbound Connection Pools -> New
And Create new JNDI for connection pool as below:-



           b.)  After that open the new created JNDI and go to Properties tab.
Enter the value of XADataSourceName. [We need to create new datasource on server or we can use existing Datasource]
 
           c.)   After creating AQAdapter Connection pool,we need to update the Plan.xml
Click on Deployments -> AQAdapter -> Click Update

           d.) Click next and then click Finish.




 

Testing


In order to test it, Create new SOAPUI project and create TestSuite in that.
Create one TestSuite Step of ‘JDBC request’. And use below code to insert message in request Queue.

DECLARE
  enqueue_options dbms_aq.enqueue_options_t;
  message_properties dbms_aq.message_properties_t;
  message_handle RAW(16);
  MESSAGE Demo.REQ_AQ_TABLE_TYP;
  message_id NUMBER;
BEGIN
  MESSAGE                            := Demo.REQ_AQ_TABLE_TYP(12345,'70','Approved');
  DBMS_AQ.ENQUEUE ( queue_name => 'Demo.REQ_aq', enqueue_options => enqueue_options, message_properties => message_properties, payload => MESSAGE, msgid => message_handle);
  COMMIT;
END


From RESP_AQ, we can confirm the message insertion as below:-                                         






Watch this space for more analysis on AQ Adapter. Will  cover implementation of New features of AQ Adapter in 12C SOA.

Saturday 13 September 2014

DVM Implementation in OSB 12C

There are many new features in Oracle Fusion Middleware 12C. One of the existing feature is out of the box functionality of DVM integration with OSB which was missing with OSB before 12C releases.
In this blog, I will explain how to use DVM in OSB 12C. Its implementation is different from the way we implement in BPEL.


  1.  Create a OSB project and inside it create one proxy service as shown below:-

   2.  Right Click on DVMDemoProject and Select New ->Domain Value Map


3.  Give  the DVM name, Column name and its values as below:-
In this example, we are going to use two systems CRM & Billing in DVM . We will pass the value of Column CRM as ‘India’ and Corresponding value of Billing i.e ‘IN’ will be fetched from DVM.



4.  Incoming req XML to be pass is as below:-

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Header></soap:Header>
   <soap:Body>
      <Country>
         <name>India</name>
      </Country>
   </soap:Body>
</soap:Envelope>

  5.  Add a assign activity in OSB Pipeline and give expression for DVM Lookup as below:-




NOTE:- It is different from BPEL in way that we add .dvm extension in lookup function but we don’t need to add that in OSB DVM Implementation.



6.   Deploy the project on server and test it as below:-








Tuesday 8 July 2014

Oracle Fusion Middleware 12C Installation steps

Here is the step by step installation of Oracle Fusion Middleware 12C:-


Download latest JDK 7 from below link:-

http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

Download Oracle Soa suite installer from below link:-

http://www.oracle.com/technetwork/middleware/soasuite/downloads/index.html?ssSourceSiteId=opn

By the end of installation , you will have two files:-
fmw_12.1.3.0.0_soa_quickstart.jar
fmw_12.1.3.0.0_soa_quickstart2.jar

Open command prompt & execute below commands:-

1.) SET JAVA_HOME=C:\Vinit\Softwares\Java\jdk1.7.0_51[Set this path as per your directory structure]
2.)%JAVA_HOME%\bin\java  –jar  fmw_12.1.3.0.0_soa_quickstart.jar

It will open a new window like below & click Next:-



Step2:- Choose the 12C Oracle Home and click next



Step3:- Click next






Step4:- Click Install





Step  5 :- 

Step 6:- Click Finish




RCU Creation:-


  1. Open command Prompt and execute below command to set Oracle Home:-
               SET JAVA_HOME=C:\Vinit\Softwares\Java\jdk1.7.0_51


     2.  Browse to below directory from command prompt

               cd <ORACLE_HOME>\oracle_common\bin

      3. Execute RCU.bat

After this a new window will appear and require some configurations:-

Step 1:-  Choose Create Repository option as below:-


Step 2:- Provide 12C Database Details. Note,  I have given 12C service name orcl2 and port 1522




Step 3:- Choose below Schemas to be created and click next



     After completion ,  click OK.



Step 4:- Define Password for schemas





Step 5:- Click Next




Step 6:- Click Create





Step 7:- Click Close




Domain Configuration:-

1.)Open Command Prompt and execute below commands:-


cd ORACLE_HOME\oracle_common\common\bin
SET CONFIG_JVM_ARGS=-Dcom.oracle.cie.config.showProfile=true
config.cmd

After this a new window will appear and require some configurations:-

1.)Select 'Create a new compact domain' option and Give a name to domain . Example:- Test_domain




2.)Choose the Products which you want to install on domain:-



3.)Click Next



4.) Choose Username and password and click next



5.)Select the Domain Mode & JDK Location  and click next



6.)Click on RCU data & then fill the Database Details . After that Click on 'Get RCU Configuration'


7.)On the Component datasources screen, Verify that the values on the JDBC Component Schema are correct   for all schemas and then click Next


8.)Use the JDBC Component Schema Test screen to test the datasource connections you have just configured



9.)On Advanced Configuration screen, click Next without selecting anything



10.) Set the admin server port



11.)On Configuration Summary Screen, click Create



12.)On the Configuration progress screen ,click Next



13.)On Configuration Success  screen ,select the check box for start  Admin server and then click Finish






Will Add description later on