• Synchronous To Asynchronous Flows Without An Orchestration的简单实现


      这段时间在做的案子有一些同步和异步的web services的处理的问题,在网上看到Paolo(Microsoft, Italy)写的Synchronous To Asynchronous Flows Without An Orchestration, 很好的实现了同步的web services调用异步的处理程序的问题。稍微改了一点内容,让其看起来更加的简单。

      做这个例子首先要理解BizTalk的消息订阅机制。

      "When a message is received through a Request-Response Receive Location and published to the BizTalkMsgBoxDb, an instance subscription is created to allow the Receive Location to receive the response back when this latter is published to the MessageBox. This subscription expression is always composed of the EpmRRCorrelationToken promoted property that is in the request message's context, and a RouteDirectToTP promoted property with a value of True. "

      这句话说明一旦消息进入到请求-响应的接受位置并且发布到BizTalkMsgBoxDb,就会创建一个实例去订阅响应的消息,这个订阅的依据就是EpmRRCorrelationToken,RouteDirectToTP。这两个值都是Microsoft.BizTalk.GlobalPropertySchemas的消息系统属性,在使用了XML Assembly的pipeline中,它们会被降级到消息中。理解了这个之后我们就可以往下做了。

    在VS中我建立了一个解决方案,这个方案包含了需要的Schema项目和Mapping项目。这两个稍后都会部署到Server上。

    (Solution)

        

    主要的就是端口的设置了。

    我建立了一个SOAP的Receive Location(将Inbound和Author的Schema发布成Requset-Response的WebServices)。将Receive的Pipeline设置为XML Receive。这个奖作为Sync的请求连接。

    接着建立一个单向的SendPort,这个SendPort的Filter里面设定了前面的接受端口名称,同时有一个OutBound Map将InboundMessage(InboundBook)处理成TempMessage(OutBoundBook)。这个SendPort的XML Transmit会做将消息的属性做降级处理。消息被发送到Temp文件夹。

    然后又做一个单向File的接受位置2从Temp文件夹查询消息。

    接着又一个发送端口2处理接受端口2 的消息,并把这个消息转换成查询的结果,并且把文件发送到Out的文件夹。

    建立一个接受端口订阅Out文件夹的消息。这个消息被订阅并发布到BizTalkMsgDB后,将会被最初的SOAP的接受端口的响应的Instance订阅,作为WebServices的请求结果返回。

    用SOAP UI测试如下:

    全部代码下载

  • 相关阅读:
    exceljs xlsx 前端生成excel 和解析excel (一)
    分片分N次请求记录,包含重试控制,前端拼接总数据数组后导出
    打包文件复制脚本
    复制到剪贴板
    去掉控制台consolelog
    axios 使用 v3
    并发 promiseAll from dalao
    axios 使用v2
    docker-compose安装sonarqube7.9
    centos7 部署minio
  • 原文地址:https://www.cnblogs.com/JasonLiao/p/2031662.html
Copyright © 2020-2023  润新知