Oracle Service Bus中的线程
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中的线程的更多相关文章
- Oracle Service Bus白皮书
Oracle Service Bus简介 面对变幻莫测的市场需求的变化,企业希望通过推进"服务化"提高敏捷性和响应能力:更方便地与客户和合作伙伴交互,更灵活地设计和构建IT基础架构 ...
- Oracle Service Bus 11g 的三种方案
使用<Oracle Service Bus 11g Development Cookbook>中的方案迅速推出一批全新的面向服务和消息的解决方案 2012 年 3 月 (单击图像了解更 ...
- Oracle Service Bus Socket Adapter调整的参数
之前在一个客户中做压力测试时候Oracle Service Bus性能大概达到900tps左右,和客户期望的1600tps有很大差距. 在研究了Socket Adapter的工作原理之后,判断可能是O ...
- Azure Service Bus 中的身份验证方式 Shared Access Signature
var appInsights=window.appInsights||function(config){ function r(config){t[config]=function(){var i= ...
- Jumpstart for Oracle Service Bus Development
http://www.oracle.com/technetwork/articles/jumpstart-for-osb-development-page--097357.html Tutorial ...
- Oracle Service Bus (OSB) 12c 的配置安装
Oracle Service Bus (OSB) 12c 的配置安装 1.OSB配置环境: Oracle Database Oracle Fusion Middleware Infrastructur ...
- 【Azure 服务总线】Azure Service Bus中私信(DLQ - Dead Letter Queue)如何快速清理
在博文ServiceBus 队列中死信(DLQ - Dead Letter Queue)问题一文中,介绍了服务总线产生私信的原因及可以通过代码的方式来清楚私信队列中的消息,避免长期占用空间(因为私信中 ...
- 利用Service bus中的queue中转消息
有需求就有对策就有市场. 由于公司global的policy,导致对公司外发邮件的service必须要绑定到固定的ip地址,所以别的程序需要调用发邮件程序时,问题就来了,如何在azure上跨servi ...
- 【Microsoft Azure学习之旅】消息服务Service Bus的学习笔记及Demo示例
今年项目组做的是Cloud产品,有幸接触到了云计算的知识,也了解并使用了当今流行的云计算平台Amazon AWS与Microsoft Azure.我们的产品最初只部署在AWS平台上,现在产品决定同时支 ...
随机推荐
- poj 2406 Power Strings(kmp循环节)
题目链接:http://poj.org/problem?id=2406 题目大意:如果n%(n-next[n])==0,则存在重复连续子串,长度为n-next[n]. 例如: a b ...
- 一张图介绍 html中offset、client、scroll、offset 、padding、margin 各种属性介绍
- POJ2680(动态规划,大数)
Computer Transformation Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 4548 Accepted ...
- cpu事实负载使用top命令
参考网址:http://www.cnblogs.com/tippoint/archive/2013/03/05/2944319.html 在系统维护的过程中,随时可能有需要查看 CPU 使用率,并根据 ...
- SSH的简单入门体验(Struts2.1+Spring3.1+Hibernate4.1)- 查询系统(下)
我们继续吧,SSH最大的优点就是实现的系统的松耦合,能够将后台和前台有机的分离开来. 一.目录结构 一个好的程序要有一个好的开始.我们先来看看整个目录结构吧 主要的是三层架构概念,或者说是mvc的概念 ...
- javascript字符串中包含特殊字符问题
我们都知道,在javascript中,字符串写在单引号或者双引号之中.因为这种要求,我们有些时候一些需要的字符串不能够被javascript解析,如下: "We are "Huma ...
- 搜索引擎--范例:谈谈django--mysql数据库的一些常用命令
现在基本没有什么能离得开数据库了,django我一直用的都是mysql的数据库,这次和大家说说django--mysql数据库的一些常用命令吧 1:命令行登陆mysql C:\Users\Admini ...
- 【C++】复制构造函数
参考资料:黄邦勇帅(里面对于临时变量的说法我不是很理解,感觉里面的解释有问题) 用到复制构造函数的情况: 1.函数值传递 2.返回对象 3.用一个对象初始化另一个对象 重点注意下面两种情况: ① 只调 ...
- lucene api
设置重新打开索引目录(清空) IndexWriterConfig conf = new IndexWriterConfig(new WhitespaceAnalyzer());conf.setOpen ...
- php发送http请求的两种常用方法
第一种:使用CURL,直接上代码,开箱即用: <?php // return file_get_contents("http://thinkphp.com/index/index/cr ...