Friday, August 25, 2017

Publish action with Error Handling in OSB 11g

There are several ways that we can invoke target service in OSB.
1. Service callout
2. Routing
3. Publish

We use Publish action when you don't need to wait for the response from target service like JMS queue, producing files or invoking one way services.(kind of fire and forget)
If we use the publish action, even though there is some error in the target service it will not stop the flow. Our flow will just move on to the next activity in the pipeline.

But in some cases we do need to handle the exception in publish, like if the webservice is down.

To catch the error, we need to add Routing Options under publish and make the quality of service to "Exactly once".

Publish with "exactly once" is architecturally equivalent to synchronous service invocation and it will be no longer a "fire and forget" invocation.

Publish action will become Synchronous call in one another case as well, if we are invoking another OSB proxy service (on Local, or on HTTP) the thread will be blocked until we get the response.



Wednesday, August 2, 2017

How to Invoke Async BPEL from Sync BPEL | Is it possible to add wait activity in Sync BPEL.?

Is it possible to invoke a Asynchronous BPEL from Synchronous BPEL.?
Yes. Its possible. 

Is it possible to add "Wait" activity in Sync BPEL.?
Yes. Its possible.

While you are trying to invoke a Async BPEL from Sync BPEL, you might notice that the invoke activity is success. But the receive activity will be in Pending state as show below.


Same for wait activity as well.

And also you might notice an error message in dashboard as below.

"Waiting for response has timed out. The conversation id is null. Please check the process instance for detail. "

To resolve this, you need to change the transaction property(in composite.xml) in Sync BPEL as,

<component name="BPELProcessXX" version="1.1">
<implementation.bpel src="BPELProcessXX.bpel"/>
<property name="bpel.config.transaction">requiresNew</property>
<property name="bpel.config.oneWayDeliveryPolicy" type="xs:string"
              many="false">async.persist</property>
</component>