Orchestration Correlation

原理简介:
orchestration里面一个消息发送出去以后,可能需要等待该消息的响应以便进一步的处理,在实际的处理时有可能同时发送多个消息出去,然后等待多个响应的返回.每个发送消息需要和响应的消息建立一一对应的关系,biztalk通过orchestration correlatoin实现该机制.关键是发送的消息和接收的消息如果需要关联的话,则都分别需要指定一个关键子,通过关联该关键字来实现correlation. 在correlation的实现中还包括hydration(水合),dehydration(脱水)的概念,也就是说需要长期等待响应的消息,将会被保存到数据库中,减少等待消息对内存的损耗.

实现简介:
一个orchestration可以有多个ReceiveShape
但是只能将其中的一个设置为activate = true , 并且也必须有一个
如果有另外一个ReceiveShape其activate = false,则必须使用Correlation将这个ReceiveShape接收的消息同之前的SendShape发送的消息通过某个字段关联起来,被关联的字段必须是消息里面被promote过的字段;否则无法通过编译.

我做了这么个测试, Send MsgA出去,Receive MsgB回来,  A.id 和 B.id 相关联 ; 在运行时,如果不Send MsgA,直接将 MsgB.xml放在B对应的接收文件夹,则B将被接收,但是无法被MsgBox Dispatch, Application Event里面有如下信息

"Event Type: Error
Event Source: BizTalk Server 2004
Event Category: BizTalk Server 2004 
Event ID: 5778
Date: 2004-7-14
Time: 14:54:18
User: N/A
Description:
The Messaging engine failed to process a message submitted by adapter:FILE Source 
URL:F:BizTalkExamplesMappingFileDropShipmentRev*.xml. Details:Could not find a 
matching subscription for the message. . This error occurs if the subscribed orchestration 
schedule or send port has not been started, or if some of the message properties necessary 
for subscription evaluation have not been promoted. Please refer to Health and Activity 
Tracking tool for more detailed information on this failure"


最后总结一下关联消息的步骤
(1)MsgA和MsgB相关联,MsgA.id = MsgB.id ; MsgA先发送出去,MsgB后接收回来
(2)创建一个Property 类型的Schema, 添加 Element Field,代表要关联的关键字id ;整个project有一个Property类型的Schema就可以了,有多个关联关键字,则添加多个Element
(3)在Schema MsgA和MsgB里面Promote相应的字段
(4)在需要进行关联的Orhestration里面Types->Correlatoin Types里面新增一个Correlatoin类型
(5)在CorrelationSet里面新增CorrelatoinSet,该Set将同Receive或Send Shape  想关联
(6)在SendShape->Initialize Correlation Set 和 ReceiveShape -> Following Correlatoin Set里面选择一种类型的CorrelationSet将发出和接收的消息相关联
注意,InitializeCorrelation和FollowingCorrelation为一对多的关系.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值