Hi Kim,

This main sequence will be invoked for all the messages coming into synapse
message mediation (i.e. if the message is not dispatched to a particular
proxy service the main sequence will be invoked), therefore it is not the
best practice to use the main sequence to send this to the proxy, there are
few disadvantages of that approach though we do not have any other
workaround for the moment till we get the ProxyInjector;

   1. If you put a send inside and in mediator this will lead to an open
   proxy [1] scenario.
   2. If you put yet another filter inside the in mediator to exactly filter
   out the messages injected by task it will affect the performance, coz it
   goes through another xpath filter.
   3. This requires a network call for the message to be dispatched to the
   proxy

ProxyInjector will not have any of the above disadvantages and it will just
inject a message to the proxy service from within the synapse environment.

Note: The set of mediators on the root level in the configuration represents
the main sequence, so in this particular case the main sequence is the in
mediator, alternatively you could wrap this in a named sequence called
"main".

[1] - http://en.wikipedia.org/wiki/Open_proxy

Thanks,
Ruwan

On Wed, Mar 11, 2009 at 10:01 AM, kimhorn <[email protected]> wrote:

>
> Hi Ruwan,
>
> thanks for that. The
>  <in>
>     <send/>
>  </in>
>
> code isn't so bad. However, I am having issues taking this toy example back
> to
> the real code....but will work it out.
> The pattern discussed used a filter, on the IN, rather than a proxy, do you
> see any benefits in either ?
>
> I will get to those Jira's.
>
> Thanks
> Kim
>
>
>
>
> Ruwan Linton wrote:
> >
> > Hi Kim,
> >
> > Task is the abstraction layer and in this particular case you are using
> > one
> > implementation of that, which is the MessageInjector which just injects a
> > message to the synapse environment... (which means to the main sequence
> of
> > synapse). The to address you specify is just used to set the To value of
> > the
> > message context so if you do a send without specifying an endpoint this
> To
> > address will be used to send the message.
> >
> > I had the idea of writing a ProxyMessageinjector so that it will be
> > injecting the messages to the specified proxy service, but didn't
> complete
> > it yet. We could get this into the 1.3 release and you are more than
> > welcome
> > to report this as an enhancement to the synapse JIRA.
> >
> > Thanks,
> > Ruwan
> >
> > On Wed, Mar 11, 2009 at 3:38 AM, kimhorn <[email protected]> wrote:
> >
> >>
> >> I assumed task would do a send if a message was injected. So this solves
> >> problem:
> >>
> >> <definitions xmlns="http://ws.apache.org/ns/synapse";>
> >>  <task class="org.apache.synapse.startup.tasks.MessageInjector"
> >> name="MyProxy">
> >>     <property name="to" value="http://localhost:8280/soap/MyProxy"/>
> >>     <property name="soapAction" value="MyProxy"/>
> >>    <property name="message">
> >>      <doNothing/>
> >>    </property>
> >>    <trigger interval="10"/>
> >>  </task>
> >>  <sequence name="DoStuff">
> >>    <log level="custom">
> >>       <property name="MSG" value="&gt;&gt;&gt;&gt;&gt;&gt;&gt; In IN
> >> Sequence"/>
> >>    </log>
> >>  </sequence>
> >>  <proxy name="MyProxy">
> >>    <target inSequence="DoStuff"/>
> >>  </proxy>
> >>  <in>
> >>     <send/>
> >>  </in>
> >> </definitions>
> >>
> >>
> >>
> >>
> >> kimhorn wrote:
> >> >
> >> > Can some one explain what is going on here:
> >> >
> >> > seting TCPMON to map 8070 to 8280 (Synapse)
> >> >
> >> > Why does this code not hit PORT 8070 ever, but goes through <in>
> >> sequence.
> >> > What is the hidden magic going on within Synapse here, can it be
> >> > documented  ?
> >> >
> >> > <definitions xmlns="http://ws.apache.org/ns/synapse";>
> >> >   <task class="org.apache.synapse.startup.tasks.MessageInjector"
> >> > name="MyProxy">
> >> >     <property name="to" value="http://localhost:8070/soap/MyProxy"/>
> >> >     <property name="soapAction" value="MyProxy"/>
> >> >     <property name="message">
> >> >       <doNothing/>
> >> >     </property>
> >> >     <trigger interval="10"/>
> >> >   </task>
> >> >   <sequence name="DoStuff">
> >> >     <log level="custom">
> >> >       <property name="MSG" value="In IN Sequence"/>
> >> >     </log>
> >> >   </sequence>
> >> >   <proxy name="MyProxy">
> >> >     <target inSequence="DoStuff"/>
> >> >   </proxy>
> >> >   <in>
> >> >     <log level="full"/>
> >> >   </in>
> >> > </definitions>
> >> >
> >> > I would like to use timer via proxy to start a sequence.
> >> > Seems REALLY ugly to have to filter the inSequence to do this ?
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Task-Implementation-tp22427256p22444676.html
> >> Sent from the Synapse - User mailing list archive at Nabble.com.
> >>
> >>
> >
> >
> > --
> > Ruwan Linton
> > Senior Software Engineer & Product Manager; WSO2 ESB;
> http://wso2.org/esb
> > WSO2 Inc.; http://wso2.org
> > email: [email protected]; cell: +94 77 341 3097
> > blog: http://ruwansblog.blogspot.com
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Task-Implementation-tp22427256p22448687.html
> Sent from the Synapse - User mailing list archive at Nabble.com.
>
>


-- 
Ruwan Linton
Senior Software Engineer & Product Manager; WSO2 ESB; http://wso2.org/esb
WSO2 Inc.; http://wso2.org
email: [email protected]; cell: +94 77 341 3097
blog: http://ruwansblog.blogspot.com

Reply via email to