synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Saminda Abeyruwan <samin...@gmail.com>
Subject Manipulating Addressing module engagement
Date Sat, 24 Dec 2005 11:08:57 GMT
Hi Folks,

Good News for Synapse. Now Rule Author can  make the  judgement to switch
on/off addressing module. But this functionality comes with constrains.

Now look at the following synapse.xml for example:

<synapse xmlns="http://ws.apache.org/ns/synapse">
    <stage name="xpath">
        <xpath expr="//ns:text" xmlns:ns="urn:text-body">
            <classmediator name="simpleRouting" class="
sampleMediators.SampleRouter"/>
            <send/>
        </xpath>
        <xpath expr="//ns:response_text" xmlns:ns="urn:text-body">
            <send/>
        </xpath>
        <xpath expr="//ns:text_addressing" xmlns:ns="urn:text-body">
            <engage-addressing-in/>
            <header type="to" value="
http://localhost:8090/axis2/services/npe"/>
            <header type="action"
value="urn:synapse/sendon-addressing-engage"/>
            <send/>
        </xpath>
        <xpath expr="//ns:response_text_addressing"
xmlns:ns="urn:text-body">
            <send/>
        </xpath>

<xpath expr="//ns:text_cnn" xmlns:ns="urn:text-body">
            <classmediator name="simpleRouting" class="
sampleMediators.SampleRouter"/>
            <send/>
        </xpath>
        <xpath expr="//ns:response_text_cnn" xmlns:ns="urn:text-body">
            <send/>
        </xpath>

    </stage>
</synapse>

If you look at carefully the rule configuration can be divided into three
sections as follows
[1]
<xpath expr="//ns:text" xmlns:ns="urn:text-body">
            <classmediator name="simpleRouting" class="
sampleMediators.SampleRouter"/>
             <send/>
         </xpath>
         <xpath expr="//ns:response_text" xmlns:ns="urn:text-body">
             <send/>
         </xpath>

and
 [2]
<xpath expr="//ns:text_addressing" xmlns:ns="urn:text-body">
             <engage-addressing-in/>
            <header type="to" value="
http://localhost:8090/axis2/services/npe"/>
            <header type="action"
value="urn:synapse/sendon-addressing-engage"/>
             <send/>
         </xpath>
         <xpath expr="//ns:response_text_addressing"
xmlns:ns="urn:text-body">
             <send/>
         </xpath>

look at the first section. No addressing is engage. Look at the second
section, there "addressing is engage".  Now look at the third section
 [3]
<xpath expr="//ns:text_cnn" xmlns:ns="urn:text-body">
            <classmediator name="simpleRouting" class="
sampleMediators.SampleRouter"/>
             <send/>
         </xpath>
         <xpath expr="//ns:response_text_cnn" xmlns:ns="urn:text-body">
             <send/>
         </xpath>

Rule Author has not engage the addressing.

Now the constraint.

If rule author engage addressing, it will affect only to the set of
Processor that synapse use for that message.
Ex:
Addressing will not affect to [3] if addressing is engage to [2].

Now if rule author wants to engage addressing to all the processors, what
she should do is,

<synapse xmlns="http://ws.apache.org/ns/synapse">
<engage-addressing-in/>
<stage name="cnn">
...
</stage>
...
...
..
..
</synapse>

Rule Author should make sure that, if addressing is gonna engage, it should
be the FIRST to engage before other processors. If NOT it will lead to a
state of instability.

I hope this explanation would help to rule authors.

Thoughts ?

Thank you

Happy Christmas Everybody

Saminda

Mime
View raw message