OSB - Publish,Routing and Service Callout
1. Service Callout
Used in real time request-response scenarios. Call a service insynchronous way. Being a synchronus call, the thread gets blocked until aresponse is returned from target service.
2. Publish
Used for Request only scenarios where you don't expect a responseback. The nature of Publish action (sync or async) will depend upon thetarget service you are invoking.
- Invoking an external service through a business service, then Publish action with Quality of Service(QoS) as "Best Effort" (default) will work like fire and forget and thread won't get blocked (async call).
- Invoking a local proxy service (proxy with transport protocol as "local") from another proxy using publish action then it would be a blocking call (synchronus call) and thread will get blocked untill the processing of local proxy finishes.
不管被调用的服务(例如WS)有没有返回值,PUBLISH方式都直接返回。
不管被调用的服务(例如WS)执行多长时间,如5分钟,PUBLISH方式都直接返回。
不管被调用的服务(例如WS)有没有返回值,OSB和被调用的服务都不报错。
3. Routing
Only can be created inside a Route Node and Route Node is the last node in arequest processing and not in the pipeline, it passes all processing to anotherservice (business or proxy). A Route Node indicates that RequestProcessing will end here and Response Processing will begin. You can not haveany node after Route Node in the message flow.
Route Node can be seen as an action which defines where a Request thread stopsand Response thread begins, in addition to what ever it does. It is know thatby-design, request and response pipelines of a OSB proxy will be in differentthreads unless other wise configured.
Routing是同步方式,如下图,如果ROUTINGNODE1中调用的服务需要执行5分钟,那么要等5分钟后,才会执行响应管道中的代码。
Good Practice
Use service callouts for message enrichment or for doing message validation.Use route node to invoke the actual service for which the proxy service is a'proxy'.
Try to design OSB proxy services in a standard VETO pattern - Validate, Enrich,Transform, rOute. Use Service callout for Validate and Enrich steps and use routenode for rOute step. This approach looks more appealing design wise.
Reference:
Thread: compare Routing action versusService Callout action versus Publish action?
Thread: Route node and Service Call outin OSB