Create Asynchronous OSB / BPEL Invocation [12c]

1. Server Configuration

1.1. Create new JMS Server

Enter the Weblogic Server (WLS), go to Services - Messaging - JMS Servers. Click New.
Fill the "Name". Leave "Scope" as default (Global). Click next.
Leave "Persistent Store" as (none). Click Next.
Choose AdminServer as "Target".

1.2. Create JMS Module

Enter the WLS, go to Services - Messaging - JMS Modules. Click New.
Enter the "Name", DemoJMSModule. Click Next.
Select "Target" AdminServer. Click Finnish and check if the new JMS Module has been created successfully.

1.3. Create Subdeployment

Click in the created JMS Module (DemoJMSModule) - Tab Subdeployments. Click New.
Select a name for the subdeployment and select the JMS Server. Click Finnish.

1.4. Create Connection Factory and JMS Topic

Click in the created JMS Module (DemoJMSModule)  - Tab Configuration. Click New.
Select Connection Factory and give a name to Connection Factory (ex. TESTConnectionFactoryand JNDI. Click Next.
The target server will be selected automatically for the Connection Factory. Click Finish.
Go to the created Connection Factory - Subdeployment. Select the desired one. Click Save.

Click in the created JMS Module (DemoJMSModule)  - Tab Configuration. Click New.
Select Topic.Click Next.
Give a name to Topic (ex. TEST_Request_Topic) and JNDI.
Select the Subdeployment created.  Finnish.

2. OSB Configuration

2.1. Create a New Business Service (BS)

(This Business Service will send messages to the Topic)

Select Transport/jms as "Definition". Next.
Select Messaging as the "Service Type", with "Request" like Text and "Response" as none. Finnish.
Change following parameters of the BS:

- Transport

Load-Balancing Algorithm round-robin
Endpoint URI - jms://localhost:7001/TESTConnectionFactory/TEST_Request_Topic

- Transport Details

Request Encoding: UTF-8
Retry Count: 0
Retry Iteration Interval: 30
Retry Application Errors: Yes

2.2. Create WSDL for the Asynchronous BS.

 WSDL must have two PortTypes/Bindings, with an operation each. Like the followiing image.




2.3. Create a New Proxy Service (PS)

(This PS will take the information from the message header - the response adress and the message ID - and will put it in the TransportHeader of the BS to which it routs)

Define the PS as a route to the BS just created. The image shows the flow and the definitions of the Assigns and TransportHeader components.

The value 167 is a message identifier from the sender, should be different if the topic is used from another OSB.


The PS configurations are:

Service Type: WSDL. It should point to the WSDL created in 2.2., pointing to the 'execute' binding.
Operation Selection : SOAP Body Type

(When executed, this PS sends a message to the Topic, with the details where to send the response to.

The BPEL will receive a message received response and the asynchronism is created, BPEL connection is closed now. The actual response will be received in other connection, created by the OSB.)


2.4. Create a New Business Server (BS).

(This Business Service will arrange a new connection, to send a response to BPEL)

Configuration:

Chose WSDL as Definition and pick the WSDL created in 2.2. pointing to the 'callback' binding.

Choose Transport as http.

Load Balancing Algorithm: round robin
Endpoint URI: http://localhost:7001/TDMI/dummy -  This endpoint is not important.
Retry Count: 0
Retry Iteration Interval: 0
Retry Application Errors: Yes
HTTP Request Method: POST

Leave the remaining as default.

2.5. Create a New Proxy Service (BS).

(PS for the callback)

Configurations:

Service Type: Messaging Service
Request Message Type: XML
Response Message Type: None 
Protocol: jms
Endpoint URI: jms://localhost:7001/TESTConnectionFactory/TEST_Request_Topic
Get All Headers: Yes
 Destination type: Topic
Message Selector: TOPIC='167'
Transaction Timeout: 3600s.


This image shows the PS configuration, with all steps, except the ServiceCallout, that one should call the Synchronous OSB to perform the job.

3. BPEL Configuration

To call the OSB use the WSDL/xsd created in 2.2. and fill the tag "service" in the end, to point to the WSDL.
See the difference between the first WSDL presented and this one, in the service tag.




3.1. Invoke the OSB

Create assign to a new variable, ConversationID, with expression oraext:generate-guid() (generates a new message code to the message).  


The partner link looks like this:

And the Invoke and Receive actions:


Comments