jib以前在给客户讲产品的时候经常提到Oracle Service Bus服务总线适合于短连接,高频率的交易,而不适合那些大报文,然后花费很长的调用时间的应用,前一阵在给客户培训完企业服务总线后,又对OSB的限流机制有了一定了解,事实上,自己的理解也有很多偏差,下面就把在国外看到的一片讲Oracle Service Bus线程机制的文章和大家分享一下吧。

企业服务总线的典型场景

如果我们把pipeline中间的逻辑拉直的话,我们可以看到基本是这个图:

  • Request Pipeline:在接收的pipeline中收到请求做处理
  • RouteNode:通过路由节点调用业务服务
  • Response Pipeline: 处理业务服务的回应,然后将结果返回.(这个图是个特例,具体是判断结果,修改请求,在去调用一个业务服务,然后回送回应)

基本模型

  • 在请求pipeline中Oracle Service Bus会启用一个线程(Thread)
  • 在调用业务服务的时候,线程释放,回到线程池,同时一个muxer等待回应
  • 当回应收到,muxer把接收到的新的请求发送给一个新的线程,并执行response pipeline.

所以

我们可以为Proxy Service和Business Service定义不同的线程池,也就是Proxy Service WorkManager和Business Service WorkManager

没有包含路由节点

如果没有路由节点,OSB仍然会采用另外一个thread处理响应pipeline,但是采用的Default Work Manager

代理服务调用代理服务

同一线程调用Proxy Service的请求Pipeline,同一线程调用Response Pipeline

服务外调

Pipeline处理会block线程直到响应能够异步返回。在进行服务外调的时候,原来的线程不会释放,muxer使用Business Service Work Manager分配一个线程来处理请求,如果大家共享一个work manager,比较容易造成死锁。

总结

  • Request Pipeline

    • Executes on Proxy Work Manager (WM) Thread so limited by setting of that WM.  If no WM specified then uses WLS default WM.
  • Route Node
    • Request sent using Proxy WM Thread
    • Proxy WM Thread is released before getting response
    • Muxer is used to handle response
    • Muxer hands off response to Business Service (BS) WM
  • Response Pipeline
    • Executes on Routed Business Service WM Thread so limited by setting of that WM.  If no WM specified then uses WLS default WM.
  • No Route Node (Echo functionality)
    • Proxy WM thread released
    • New thread from the default WM used for response pipeline
  • Service Callout
    • Request sent using proxy pipeline thread
    • Proxy thread is suspended (not released) until the response comes back
    • Notification of response handled by BS WM thread so limited by setting of that WM.  If no WM specified then uses WLS default WM.
      • Note this is a very short lived use of the thread
    • After notification by callout BS WM thread that thread is released and execution continues on the original pipeline thread.
  • Route/Callout to Proxy Service
    • Request Pipeline of callee executes on requestor thread
    • Response Pipeline of caller executes on response thread of requested proxy
  • Throttling
    • Request message may be queued if limit reached.
    • Requesting thread is released (route node) or suspended (callout)

Oracle Service Bus中的线程的更多相关文章

  1. Oracle Service Bus白皮书

    Oracle Service Bus简介 面对变幻莫测的市场需求的变化,企业希望通过推进"服务化"提高敏捷性和响应能力:更方便地与客户和合作伙伴交互,更灵活地设计和构建IT基础架构 ...

  2. Oracle Service Bus 11g 的三种方案

    使用<Oracle Service Bus 11g Development Cookbook>中的方案迅速推出一批全新的面向服务和消息的解决方案 2012 年 3 月   (单击图像了解更 ...

  3. Oracle Service Bus Socket Adapter调整的参数

    之前在一个客户中做压力测试时候Oracle Service Bus性能大概达到900tps左右,和客户期望的1600tps有很大差距. 在研究了Socket Adapter的工作原理之后,判断可能是O ...

  4. Azure Service Bus 中的身份验证方式 Shared Access Signature

    var appInsights=window.appInsights||function(config){ function r(config){t[config]=function(){var i= ...

  5. Jumpstart for Oracle Service Bus Development

    http://www.oracle.com/technetwork/articles/jumpstart-for-osb-development-page--097357.html Tutorial ...

  6. Oracle Service Bus (OSB) 12c 的配置安装

    Oracle Service Bus (OSB) 12c 的配置安装 1.OSB配置环境: Oracle Database Oracle Fusion Middleware Infrastructur ...

  7. 【Azure 服务总线】Azure Service Bus中私信(DLQ - Dead Letter Queue)如何快速清理

    在博文ServiceBus 队列中死信(DLQ - Dead Letter Queue)问题一文中,介绍了服务总线产生私信的原因及可以通过代码的方式来清楚私信队列中的消息,避免长期占用空间(因为私信中 ...

  8. 利用Service bus中的queue中转消息

    有需求就有对策就有市场. 由于公司global的policy,导致对公司外发邮件的service必须要绑定到固定的ip地址,所以别的程序需要调用发邮件程序时,问题就来了,如何在azure上跨servi ...

  9. 【Microsoft Azure学习之旅】消息服务Service Bus的学习笔记及Demo示例

    今年项目组做的是Cloud产品,有幸接触到了云计算的知识,也了解并使用了当今流行的云计算平台Amazon AWS与Microsoft Azure.我们的产品最初只部署在AWS平台上,现在产品决定同时支 ...

随机推荐

  1. 51nodeE 斜率最大

    题目传送门 这道题只要证明最佳解一定在相邻两个点之间的好啦 这个自己证一证就okay啦 而且我发现n方的算法可以过耶... #include<cstdio> #include<cst ...

  2. 下拉列表 JComboBox 的使用

    下拉列表(JComboBox)通常显示一个可选条目,允许用户在一个下拉列表中选择不同条目,用户也可以在文本区内输入选择项. package first; import java.awt.FlowLay ...

  3. (转)Git冲突:commit your changes or stash them before you can merge. 解决办法

    用git pull来更新代码的时候,遇到了下面的问题: error: Your local changes to the following files would be overwritten by ...

  4. Mac升级Vim

    Mac自带的vim版本过低,可以使用如下方式进行升级,说白了就是备份替换: 1. 使用port安装新的vim,安装目录在/opt/local sudo port install vim 2. 如果已经 ...

  5. Linux下安装mantis配置指南【转】

    转自:http://blog.csdn.net/xabc3000/article/details/6858229 目录(?)[-] Linux下安装mantis配置指南 配置Linux下的Apache ...

  6. try_module_get和module_put【转】

    转自:http://blog.csdn.net/adaptiver/article/details/7000617 转自:http://apps.hi.baidu.com/share/detail/4 ...

  7. ajax 请求 ascx

    尝试了很多方法,ajax 都无法请求 ascx 后台方法 求解!

  8. 数据类型转换,JS操作HTML

    数据类型转换 1.自动转换(在某种运算环境下) Number环境 String环境 Boolean环境 2.强制类型转换 Number() 字符串:纯数字和空字符转为正常数字,其他NaN 布尔值:tu ...

  9. js面向对象编程(二)构造函数的继承(转载)

    Javascript面向对象编程(二):构造函数的继承 这个系列的第一部分,主要介绍了如何"封装"数据和方法,以及如何从原型对象生成实例. 今天要介绍的是,对象之间的"继 ...

  10. BZOJ 1432

    Description Input 一行两个整数n; k. Output 一行一个整数,表示n 个函数第k 层最少能由多少段组成.     #include<iostream> using ...