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)

最新文章

  1. 显示python已安装模块及路径,添加修改模块搜索路径
  2. 【转】Linux查看机器负载
  3. [Cocos2d-x For WP8]Layer 层
  4. CentOS6.5安装iftop
  5. Valgrind简单用法
  6. mark标签:
  7. 一个layer可以跟着画完的线移动ios程序 好玩啊。
  8. Hibernate save或者persist 后获取主键ID
  9. leetcode第一刷_Construct Binary Tree from Preorder and Inorder Traversal
  10. XBOX360 硬盘玩游戏
  11. CTF---密码学入门第六题 古典密码
  12. Spark技术内幕: 如何解决Shuffle Write一定要落盘的问题?
  13. 007-li标签CSS水平居中垂直居中
  14. windows远程桌面连接时,显示发生身份验证错误,给函数提供的身份无效
  15. 牛客OI周赛6-提高组 B 践踏
  16. yii配置访问路由权限配置
  17. java使用正则表达式
  18. sass:常用备忘
  19. mysql内存评估计算
  20. RESTful API 和 Django REST framework

热门文章

  1. poj3580 序列之王 fhqtreap
  2. Linux中实现一个简单的进度条【转】
  3. Google开源命令行参数解析库gflags
  4. ReadOnly与Enabled
  5. phpstudy2014没有mysqldumpslow.pl及其在性能优化的作用
  6. picker鼠标上下拖动选择内容
  7. C#实例:Unity依赖注入使用
  8. redis.clients.jedis.HostAndPort - cant resolve localhost address
  9. docker从零开始网络(四 ) host网络
  10. Redis安装-CentOs7