BizTalk - Carefully use Send Port Group

1. Why Send Port Group?

You want BizTalk Server to send the same message to multiple downstream systems for further processing. Send Port Group is designed to serve this purpose.

2. How dose Send Port Group work with Send Ports?

1). You can stop all the Send Ports within Send Port Group, in this case message routing will fail, and NO messages will be subscribed and routed, that’s to say all the messages will be suspended.

2). you can just stop the Send Port Group with all the Send Ports within it enabled. Send Port Group has no impact on send ports. Messages will be subscribed by Send Ports.

3. If filters are applied both to Send Ports and Send Port Group, what’ going to happen?

Filters on send port groups do not override filters on individual send ports. Filters

used on both send ports and a send port group operate in a cumulative nature. If the

same filter is used on a send port group as well as the individual send ports within the

group, it’s likely that duplicate messages will be sent. Special care must be given if filters

are implemented on both send ports and send port groups.----------------<BizTalk 2006 Recipes>

Here is the schema we are gonna use. Profession fields is promoted for routing.

clip_image002

For sample files are created for testing purpose.

clip_image004

They are sharing the same format.

<ns0:Person xmlns:ns0="http://SendPortGroupTest.Person">

<name>Zack Zhao</name>

<age>28</age>

<profession>Programmer</profession>

</ns0:Person>

From the file name you can see there are two Teachers and two programmers.

After the demo project is deployed on destination box, one Receive Port along with its corresponding Receive Location, three Send Ports and one Send Port Group are created for receiving and subscribing messages.

clip_image006

The directories for receiving and sending messages are shown below.

clip_image008

The Receive Port (Rcv_Person in this example) will receive message from IN folder and drop them to MsgBox).

SendPort_All will subscribe all the messages receive by Rcv_Person and send message to All folder. Likewise, SendPort_Programmer will subscribe the messages which has profession = Programmer, SendPort_Teacher will take care of the messages with profession = teacher.

Now drop the four messages into in folder, open the following three folders All, Programmer and Teacher. You will find 8 files in All, 6 files in Programmer and Teacher. BUT open the files in Programmer folder one by one, see what happens. Some two files have profession = Teacher, similar thing happened to Teacher folder.

clip_image010 clip_image012

The following picture demonstrates how filters work in this situation.

 

 From the chart, all the messages subscribed by Send Port Group will go through all the Send Ports within it not matter the messages meet their filter criteria or not.

In this example, SendPort_Teacher will have

(Teacher1.xml+Teacher2.xml) * 2+ Programmer1.xml+Programmer2.xml =6 files sent to Teacher foler.

SendPort_Programmer will have

(Programmer1.xml+ Programmer2.xml) * 2+ Teacher1.xml+Teacher2.xml =6 files sent to Programmer folder.

SendPort_All will have (Programmer1.xml+ Programmer2.xml+ Teacher1.xml+Teacher2.xml) *2 = 8 files sent to All folder.

4. Other limitations/concerns.

One-way static ports: Send port groups can use only static one-way send ports. The strength

of send port groups is the ability to send the same message to multiple subscribers. However,

one limitation of send port groups is that they can include only static one-way send

ports.

Operating states: The operating state between send ports and send port groups is independent.

The states between send ports and send port groups are identical:

Bound: The send port or send port group has been physically linked to an

orchestration.

Enlisted: The send port or send port group has been associated with the message

to which it will be subscribing from the MessageBox.

Started: The send port or send port group is ready to process messages matching

the appropriate message subscription.

Enlisted ports: You must verify that both send ports and their parent send port groups have

been enlisted and started before messages will be sent. Additionally, send ports must be

enlisted or started before a send port group can be started. However, a send port group can

be enlisted, regardless of the state of the individual send ports it references. The send port

group must be stopped before all of the individual send ports can be unenlisted.

posted @ 2008-05-29 08:46  zhanqiangz(闲云野鹤)  阅读(2238)  评论(1编辑  收藏  举报