"WCF Technology Insider" translation 14:1th Part _ 3rd Chapter _ Message Exchange Mode, topology and choreography: Message Exchange Mode (MEP)
3rd Chapter: Message Exchange Mode, topology and choreography
When designing a messaging application system, it is important to consider how messages flow through the sender, broker, and recipient (the message participants are described in the previous section). The value of the fluctuation of the possibility of message exchange in the system can be described in detail in different degrees. These different levels of detail are known as Message exchange modes (MEPS), message topologies, and message orchestration "old Xu Notes 1". As a whole, these three levels of detail let us abstract the description of any message scenario. This chapter examines in detail the message exchange patterns (MEPS), message topologies, message orchestration, and how they are used in WCF application systems to provide advanced functionality.
Message Exchange Mode
We describe the most common details of message exchange granularity is the message Exchange Mode (MEP). According to the draft Consortium (HTTP://WWW.W3.ORG/2002/WS/CG/2/07/MEPS.HTML), a MEP is "a template that describes the messages exchanged between message participants." "A MEP is limited to a logical connection between the sender and the receiver, and the industry has accepted the fact." Because MEPs is a somewhat abstract concept, a close look at some real-world examples is helpful for us to understand the concept of MEPs. Let's take a look at the following examples of my friends and I talk about football tickets:
1.我拿起电话,打给Rusty。
2.Rusty拿起手机。
3.Rusty说:Hello。
4.我说:你看今天的比赛了吗?
5.Rusty说:是的,踢得太烂了。真难相信我们没有赢。
6.Rusty说:他们全部哑火了。
对话继续…
1-3 steps can be considered a transmission specification event (I call Rusty, he picks up the phone, prepares a call). In the 4th step, I sent rusty a message in the form of a question, accustomed to telling me that he should answer. The 5th step, Rusty sent me a message as a response to the question. The 6th step is unsolicited request message, sent to me, I can respond or not respond. The relevance of this message is very implicit, as it is part of the conversation flow. If there was no correlation between the scenes, I would not know what he was talking about, which would be bad. It's like a sales call or a chess game.
In this scene, Rusty and I can say anything (like Step 6), and we can talk about it one after another. A one-way conversation is also possible, like a shareholder teleconference, or because one side terminates the call before the response is sent, let's look at another example of a phone call:
1.Lewis(我老板)拿起电话,拨我的手机号。
2.我拿起手机说:“Hello”。
3.Lewis说:“你干的太好了。我会立即给你100%的加薪,”。
4.Lewis挂断了电话。
5.我打回给Lewis。
6.Lewis接电话。
7.我说:“你太大方了,我只要50%就可以啦。”。
8.我挂断电话。
9.Lewis又打过来。
10.我接听电话
11.Lewis说:“100%加薪是最终结果,我现在正开一个蓝色保时捷911 Turbo 赶过去,确保你能和我签约。”
12.Lewis又挂了。
In the previous scene, I could respond, but Lewis was so interested in giving me a raise that he didn't listen to my answer. I just need to call him back. Further discussion of the details. Conceptually, the response in a message exchange requires the sender to listen for a connection that exists or a new connection.
A more rigorous model can be used for calls. Think about the conversation between the pilot and the airport control tower, and if you've heard the communication, the structure is obvious:
1.控制台呼叫飞行员:“Contoso437,转向180度,300哩(节/小时, 飞行速度),下降到10000英尺。”
2.飞行员回答:“Contoso437,正在转向180度,300哩(节/小时,飞行速度) ,正要下降到10000英尺”。
In this scenario, the control tower changes request and asks for a reply. If the plane does not respond, the wordy console repeats the instruction until a response is received, or some other action is taken. Further, the agreement requires pilots not to interrupt the tower when the control tower is communicating.
These simple metaphors are useful for understanding the interaction between message participants in a service-oriented application system. In a nutshell, MEPs is based on how the participants interact, or rather, the number of allowed replies and the need for a new connection to be sorted between the sender and the recipient. There may be a difference between a phone and a wireless call, but there are usually 3 types of MEPs in a service-oriented world: datagram, request-reply, and duplex.