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. 【STSRM13】木之本樱

    [题意]抽象模型后转化为:给定n个直线,ans+=C(x,4)*8,x为每个经过直线数>=4的点的直线数,不存在平行直线. [算法]数学 [题解] 运用了一个很简单的道理:经过同一个点的线段互相 ...

  2. 【洛谷 P2515】 [HAOI2010]软件安装 (缩点+树形背包)

    题目链接 看到代价和价值这两个关键词,肯定是首先要想到背包的. 但是图中并没有说这是棵树,所以先要\(Tarjan\)缩点,然后就是选课了,跑一遍树形背包就好了. 注意:缩点后应该是一个森林,应该用一 ...

  3. 【洛谷 P1645】 序列 (差分约束)

    题目链接 差分约束. 设\(s[i]\)表示前\(i\)个位置有多少个数,那么对于一个限制条件\((L,R,C)\),显然有 \[s[R]-s[L-1]>=C\] 于是连一条\(L-1\)到\( ...

  4. bzoj 1588 裸平衡树

    //By BLADEVIL #include <cstdio> #include <set> #define inf 1<<30 using namespace s ...

  5. [转]如何整理Linux磁盘碎片,竟与Windows的方式大不同 返回操作系统首页

    Linux 系统永远不需要整理磁盘碎片的神话相信很多人都听说过.由于 Linux 采用了优秀的日志文件系统(ext2.ext3.ext4, btrfs等),在绝大多数情况下确实是不需要进行磁盘碎片整理 ...

  6. go的websocket实现

    websocket分为握手和数据传输阶段,即进行了HTTP握手 + 双工的TCP连接 RFC协议文档在:http://tools.ietf.org/html/rfc6455 握手阶段 握手阶段就是普通 ...

  7. JavaScript的字符串详解

    #转载请留言联系 字符串合并 + var str1="chi"; var str2="chung"; console.log(str1+str2) 输出:chi ...

  8. docker从零开始(五)堆栈初体验,stacks

    先决条件 安装Docker 1.13或更高版本. 获取Docker Compose,请参考第三节 按照第四节中的描述获取Docker Machine. 在第二节中了解如何创建容器. 确保您的图像作为已 ...

  9. VS2010编写C++程序出现error C1010: 在查找预编译头时遇到意外的文件结尾。是否忘记了向源中添加“#include "StdAfx.h"”?

    用VS2010编写C++程序,编译时出现如下错误: 修改方法: 右击项目,选择属性 点击确定,重新编译,错误解决.

  10. Android 用AsyncTask下载网络图片并显示百分比

    1.添加布局文件:activity_main.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/a ...