Tuesday, October 29, 2013

OSB thread management across LOCAL Proxy Service invocation

I grew in the faith that a Publish (one way) operation would be carried in a separate thread form the calling thread, even much so when you use QoS = Best Effort and no transactions.
Here http://docs.oracle.com/cd/E23943_01/admin.1111/e15867/modelingmessageflow.htm#OSBAG181 at chapter 37.12.1.3 it says:

The Oracle Service Bus threading model works as follows:

    The request and response flows in a proxy service execute in different threads.

    Service callouts are always blocking. An HTTP route or publish action is non-blocking 
    (for request/response or one-way invocation), if the value of the qualityOfService 
    element is best-effort.

    JMS route actions or publish actions are always non-blocking, but the response 
    is lost if the server restarts after the request is sent because Oracle Service Bus 
    has no persistent message processing state.


I tried from a HTTP ServiceA to do:
  • a service callout
  • a publish
  • a route
to a LOCAL ServiceB, and with a Java callout I was getting the thread name in ServiceA and ServiceB. This either with Transaction Required enabled or not (on both services), and with Qos = Exactly Once or Best Effort.
In ALL cases, much to my surprise, the same thread was executing both ServiceA and ServiceB.



1 comment:

Steffen Rumpf said...

That's the same we experienced here. I guess that's because of some internal optimization mechanisms used for proxy services (not only local once) executed from within another proxy: They always try to run it on the same thread on the same node etc. The documentation basically refers to "external" services not hosted on the OSB (I did not try but I guess it's like this).

Sorry for replying on that old post ;)

Regards
Steffen