OSB - Publish,Routing and Service Callout区别

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

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值