AS11 Oracle B2B Sync Support - Series 2
By Sinkar on May 27, 2010
In the earlier series, we discussed about how to model "Sync Support" in Oracle B2B. And, we haven't discussed how the response can be consumed synchronously by the back-end application or initiator of sync request.
In this sequel, we will see how we can extend it to the SOA composite applications to model the end-to-end usecase, this would help the initiator of sync request to receive the response synchronously.
Series 2 - is little lengthier for blog standards so be prepared before you continue further :).
Let's start our discussion with a high-level scenario where one need to initiate a synchronous request and get response synchronously. There are various approaches available, we will see one simplest approach here.
1. Oracle B2B
2. Oracle JCA JMS Adapter
3. Oracle BPEL
4. All of the above are wrapped up in a single SOA composite application.
Skipping the "Sync Support" setup part in B2B, as we have already discussed that in the earlier series 1. Here we have provided "Sync Support" samples that can be imported to B2B directly and users can start testing the same in few minutes.
Pre-requisites: Create JMS Queues as mentioned below, if you opt not create the queues as mentioned below then you may have to change the queue names in B2B and Composite applications. To avoid all this, we would recommend you to follow the blog as it is to start with.
This requires two JMS queues to be created, one for B2B to receive initial outbound sync request and the other is for B2B to deliver the incoming sync response to the back-end.
Please enable "Use JMS Id" option in both internal listening and delivery channels. This would enable JCA JMS Adapter to correlate the initial B2B request and response and in turn it would be returned as synchronous response of BPEL.
Internal Listening Channel Image:
Internal Delivery Channel Image:
To get going without much challenges, just create queues in Weblogic with the JNDI mentioned in the above two screenshots. If you want to use different names, then you may have to change the queue jndi names in sample after importing it into B2B.
Here are the Queue related JNDI names used in the sample,
1. Internal Listening Channel Queue details,
JNDI Name: jms/b2b/syncreplyqueue
2. Internal Delivery Channel Queue details,
JNDI Name: jms/b2b/syncrequestqueue
Here is the Initiator Sample
Note: You may have to adjust the ip address of GlobalChips endpoint in the Delivery Channel.
Contains B2B meta-data and the Callout. Just import the sample and place the callout binary under "/tmp/callout" directory.
If you choose to use a different location for callout, then you may have to change the same in B2B Configuration after importing the sample.
Here are the artifacts,
1. Callout Source
2. Callout Binary
3. Responder Sample
Just gives the static response XML that needs to be sent back as response for the inbound sync request. For a sample purpose, we have given static response but in production you may have to invoke a web service or something similar to get the response.
For Sync Support use case, responder is not expected to deliver the inbound sync request to backend as the process of delivering and getting the response from backend are expected from the Callout.
This default behavior can be overridden by enabling the config property "b2b.SyncAppDelivery=true" in B2B config mbean (b2b-config.xml). This makes B2B to deliver the inbound sync request to be delivered to backend queue but the response to be sent to remote caller still has to come from Callout.
2. Oracle JCA JMS Adapter:
On the initiator side, we have used JCA JMS Request/Reply pattern to send/receive the synchronous message from B2B.
3. Oracle BPEL:
Exposes WS-SOAP Endpoint that takes payload as input and passes the same to B2B and returns the synchronous response of B2B as SOAP response. For outside world, it looks as if it is the synchronous web service endpoint but under the cover it uses JMS to trigger/initiate B2B to send and receive the synchronous response.
4. Composite application:
All the components discussed above are wired in SOA composite application that helps to model a end-to-end synchronous use case. Here's the composite application, you may just deploy this to your AS11 SOA to make use of it. For any editing, you can just import the project in your JDEV under any SOA Application.
Here are the composite application screenshots,
BPEL With JCA JMS Adapter (Request/Reply):