<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Mediation Patterns for Message Exchange Protocols</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Stanislav Pokraev</string-name>
          <email>Stanislav.Pokraev@telin.nl</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Manfred Reichert</string-name>
          <email>M.U.Reichert@ewi.utwente.nl</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Center for Telematics and Information Technology, University of Twente</institution>
          ,
          <addr-line>P.O. Box 217, 7500 AE Enschede</addr-line>
          ,
          <country country="NL">The Netherlands</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Telematica Instituut</institution>
          ,
          <addr-line>P.O. Box 589, 7500 AN Enschede</addr-line>
          ,
          <country country="NL">The Netherlands</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Systems interact with their environment (e.g., other systems) by exchanging messages in a particular order. Interoperability problems arise when systems do not understand each other's messages or follow incompatible message exchange protocols. In this paper we identify mismatches in message exchange protocols (involving two systems) and we propose solution patterns to compensate these mismatches.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1 Introduction</title>
      <p>In order to interoperate systems must follow compatible message exchange
protocols. For example, if one system first sends message M1 and then message M2, the
partner system should be able to receive these two messages in the same order (i.e.,
M1 before M2). However, autonomous systems (especially when built in isolation) do
not always use compatible message exchange protocols and therefore cannot
interoperate. To compensate such mismatches and to make systems interoperable we need an
additional system, which we denote as process mediator.</p>
      <p>In this paper we identify the most common mismatches in message exchange
protocols and propose respective process mediators to compensate these mismatches.
Our findings are based on the result of a literature study [1][2][3][4] and a case
study[5].</p>
      <p>We illustrate the patters using the notation depicted in Figure 1.</p>
      <p>System</p>
      <p>Message
sending</p>
      <p>Message
receiving</p>
      <p>Condition</p>
    </sec>
    <sec id="sec-2">
      <title>Mediation Patterns</title>
      <p>In the following we summarize typical mismatches in message exchange protocols
and propose mediation patterns to compensate them.</p>
      <p>Problem: System A intends to send two messages, first M1 and then M2, whereas
system B expects only message M2.</p>
      <p>Solution: Mediator M receives message M1 and ignores it. Next, it receives
message M2 and forwards it to system B. This pattern is illustrated in Figure 2.</p>
      <p>Problem: System B expects two messages, M1 and M2, whereas system A intends
to send only message M2.</p>
      <p>Solution: Mediator M receives message M2 from system A. Next, it uses
additional information (either provided by another system or derived from the execution
history) to construct and send message M1 to system B. Finally, the mediator sends
message M2 to system B. Note, that this mismatch can only be compensated if
mediator M has all information necessary to construct message M1. This pattern is
illustrated in Figure 3.</p>
      <p>A</p>
      <p>M</p>
      <p>B
M1
M2</p>
      <p>M2</p>
      <p>A</p>
      <p>M
M2</p>
      <p>B
M1
M2</p>
      <p>Problem: System A sends message M1 to system B and continues without
expecting an acknowledgement, whereas system B intends to send message Mack to
acknowledge the reception of message M1.</p>
      <p>Solution: Mediator M receives message M1 from system A, sends it to system B,
and then receives the acknowledgement Mack on behalf of system A. This pattern is
illustrated in Figure 4.</p>
      <p>Problem: System A sends message M1 and expects acknowledgement Mack
whereas system B does not intend to send such an acknowledgement.</p>
      <p>Solution: Mediator M receives message M1, sends it to system B, and then sends
an acknowledgement (Mack) to system A on behalf of system B. This pattern is
illustrated in Figure 5.</p>
      <p>A
M1</p>
      <p>M1</p>
      <sec id="sec-2-1">
        <title>Mack</title>
        <p>M1</p>
      </sec>
      <sec id="sec-2-2">
        <title>Mack M1</title>
        <p>Problem: System A intends to send message M1 first and then M2, whereas system
B expects first message M2 and then M1.</p>
        <p>Solution: Mediator M receives first message M1 and then message M2. Next, it
sends message M2 first and then message M1. This pattern is illustrated in Figure 6.</p>
        <p>Problem: System B expects two messages M2 and M3 whereas system A intends to
send only one message M1 that contains both M2 and M3.</p>
        <p>Solution: Mediator M first receives message M1. Then it uses the information
from M1 to construct M2 and M3. Finally, the mediator sends M1 and M2 in the
order expected by system B. This pattern is illustrated in Figure 7.</p>
        <p>Problem: System B expects message M2 n times whereas system A intends to
send only one message M1 that contains all n messages M2.</p>
        <p>Solution: Mediator M first receives message M1. Then it starts a process of
constructing M2 from the information in M1 and sending M2 to system B. This process
is repeated until some condition evaluates to true. The pattern is illustrated in Figure
8.</p>
        <p>A
M1
M1</p>
        <p>M2
M2
M3</p>
        <p>M3
A</p>
        <p>M</p>
        <p>B
M1
M2</p>
        <p>A</p>
        <p>M
M1</p>
        <p>M2</p>
        <p>B</p>
        <p>Problem: System A sends message M1 n times whereas system B expects one
single message M2 that aggregates all n messages M1.</p>
        <p>Solution: Mediator M starts a process of receiving messages M1 until some
condition evaluates to true. Next, it uses the information in the received messages to
construct M2 and then sends M2 to system B. This pattern is illustrated in Figure 10.</p>
        <p>The presented mediation patterns address only mismatches in message exchange
protocols. Some of the patterns (e.g., message splitting and aggregation) require
semantic mapping between the data in the exchanged messages. Only if such mappings
exist the mediators can construct an output message(s) provided input one(s).</p>
        <p>More complex patterns can be constructed using the ones presented in the previous
section. For example, splitting message M1 to three messages M2, M3 and M4 can be
achieved by composing two ‘message splitting patterns’ (cf. Figure 11). Likewise,
changing the order of three messages can be achieved by extending the message
reordering pattern (cf. Figure 12), etc.</p>
        <p>A Ma A M</p>
        <p>M1
M2
M3</p>
        <p>M3
M2
M1</p>
        <p>B</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Acknowledgments</title>
      <p>The present work has been done in the Freeband Communication project A-Muse
(http://a-muse.freeband.nl). Freeband Communication (http://www.freeband.nl) is
sponsored by the Dutch government under contract BSIK 03025. The presented work
a result of collaboration between the Telematica Instituut and the University of
Twente, the Netherlands, which is partially supported by the Commission of the
European Communities under the sixth framework programme (INTEROP Network
of Excellence, Contract N° 508011, http://www.interop-noe.org/).</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          <string-name>
            <surname>Bussler</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          <article-title>B2B-Integration: Concepts and Architecture</article-title>
          . Springer-Verlag,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          <string-name>
            <surname>Cimpian</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Mocan</surname>
            ,
            <given-names>A. Process</given-names>
          </string-name>
          <article-title>Mediation in WSMX</article-title>
          .
          <source>WSMX Working Draft, 08 July</source>
          <year>2005</year>
          . http://www.wsmo.
          <source>org/TR/d13/d13.7/v0</source>
          .1/ Hohpe, G. and
          <string-name>
            <surname>Woolf</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          <string-name>
            <surname>Enterprise Integration</surname>
          </string-name>
          <article-title>Patterns: Designing, Building, and Deploying Messaging Solutions</article-title>
          .
          <string-name>
            <surname>Addison-Wesley Professional</surname>
          </string-name>
          ,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          Wiley-Interscience,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          <source>Semantic Web Services Challenge</source>
          <year>2006</year>
          , http://sws-challenge.org
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>