Sunday, January 6, 2013

BPEL to OSB Transaction Propagation using SB Transport

How do we propagate the transaction from BPEL to OSB.

I am trying here a special use case



Ø  Place Message in the source queue

Ø  BPEL process consumes the message

Ø  BPEL then invokes a OSB proxy service

Ø  OSB proxy service invokes an OSB business service

Ø  OSB business service post the message to an outbound queue

If any error happens in the OSB layer, the transaction should roll back and the message has to be redelivered till the redelivery limit specified for the message. After the redelivery limit is reached the message should be stored in an error queue


Step 1

Create the following three queues in the weblogic domain

 1) MyDistributedQueue
 2) ErrorQueue
 3) TestOutQueue





Open MyDistiburedQueue and go to the tab "DeliveryFailure" and configure the ErrorQueue



Lets first do a positive test

1) Create BPEL Consumer Process which consumes message from the MyDistributedQueue
2) Create an OSB proxy service using SB Transport
3)OSB proxy then calls the OSB business service , which inturn send the message to the target queue.
4) Since SB Transport is used we need to use DirectBinding option from BPEL to call the OSB proxy service

OSB Proxy Service using SB Transport



OSB business service configuration


BEPL Process which consumes message from the source queue and calls the OSB Proxy Service




BPEL uses Direct Binding to invoke OSB ProxyService which uses SB Transport



Now post a message to the source queue

There is no error anywhere in the service and  BPEL consumes the message and send to OSB sucessfully



We can see the message in the target queue


Now lets simulate an error in the OSB Layer. Instead of an actual endpoint URI , change it to a wrong end point

Again post a message to the source queue


Now we can see the exceptions in the OSB logs


Now the transaction rolls back and the message is getting redelivered 3 times

Now in the target queue there wont be any message
Where as the message will be visible in the error queue configured for the source queue after the redelivery limit is reached
So by this approach the message is preserved in the error queue irrespective of  the error happened in BPEL layer or OSB layer

5 comments:

  1. Hi,I have a service which is atomic transaction, So when we are invoking atomic transactional service over proxy service, we are getting the error "Transaction context is required", As for same we added policy file of AT in business and proxy service but again we are getting same error.
    please help me

    ReplyDelete
  2. Have you tried by enabling the 'TransactionRequired' check box on the proxy?

    Are you calling the OSB Proxy Service from BPEL? In that case is the BPEL starting/carrying a transaction?

    ReplyDelete
  3. I am calling osb sb-direct proxy from my bpel.




    t3://equity.prosense.co.in:7005



    problem is it replays me same msg which i send in request msg andit wont invoke osb sb proxy...

    can you please help me ...its little urgent

    ReplyDelete



  4. t3://equity.prosense.co.in:7005

    ReplyDelete
  5. Hi,
    Is your bpel sync.Are u not setting bpel transaction properties to achieve this transaction propagation from bpel to osb

    ReplyDelete