synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kimhorn <kim.h...@icsglobal.net>
Subject Re: Chaining Sample for Release 1.3
Date Mon, 11 May 2009 00:04:27 GMT

No it works fine, was older snapshot that had different issue but is fine
now; here is test case and example.
Would be good to add these two chaining examples.

VFS File Cnaining Example, uses sample 254 data:


<definitions xmlns="http://ws.apache.org/ns/synapse">
	<proxy name="StockQuoteProxy" transports="vfs">
		<parameter name="transport.vfs.FileURI">file:///C:/test/in</parameter>
<!--CHANGE-->
		<parameter name="transport.vfs.ContentType">text/xml</parameter>
		<parameter name="transport.vfs.FileNamePattern">.*\.xml</parameter>
		<parameter name="transport.PollInterval">15</parameter>
		<parameter
name="transport.vfs.MoveAfterProcess">file:///C:/test/original</parameter>
<!--CHANGE-->
		<parameter
name="transport.vfs.MoveAfterFailure">file:///C:/test/original</parameter>
<!--CHANGE-->
		<parameter name="transport.vfs.ActionAfterProcess">MOVE</parameter>
		<parameter name="transport.vfs.ActionAfterFailure">MOVE</parameter>
        <target>
            <endpoint>
                <address
uri="http://localhost:9000/soap/SimpleStockQuoteService"/>
            </endpoint>
            <outSequence>
                 <log level="custom">
                   <property name="LAST PRICE"
expression="//ns:getQuoteResponse/ns:return/ax:last"
xmlns:ns="http://services.samples/xsd"
xmlns:ax="http://services.samples/xsd"/>
                 </log>

                 <filter
xpath="fn:number(//ns:getQuoteResponse/ns:return/ax:last) > 70"
xmlns:ns="http://services.samples/xsd"
xmlns:ax="http://services.samples/xsd">
                   <then>
                     <log level="custom"><property name="MSG" value="send
again"/></log>
                     <script language="js"><![CDATA[
                           var symbol =
mc.getPayloadXML()..*::symbol.toString() + "_RETRY";
                           mc.setPayloadXML(
                              <m:getQuote
xmlns:m="http://services.samples/xsd">
                                 <m:request>
                                    <m:symbol>{symbol}</m:symbol>
                                 </m:request>
                              </m:getQuote>);
                     ]]></script>
                     <send>
                        <endpoint>
                            <address
uri="http://localhost:9000/soap/SimpleStockQuoteService"/>
                        </endpoint>
                     </send>
                   </then>
                   <else>
                     <log level="custom">
                        <property name="MSG" value="send reply"/>
                     </log>

				<property name="transport.vfs.ReplyFileName"
					expression="fn:concat(fn:substring-after(get-property('MessageID'),
'urn:uuid:'), '.xml')" scope="transport"/>
				<property action="set" name="OUT_ONLY" value="true"/>
				<send>
					<endpoint>
						<address uri="vfs:file:///C:/test/out"/> 
					</endpoint>
				</send>
                   </else>
                 </filter>
            </outSequence>
        </target>
    </proxy>
</definitions>







kimhorn wrote:
> 
> Would be good if Asanka's Chaining sample could be added in for Release 3
> and also a test case for this.
> I think this example poses a problem if the proxy is changed to a VFS file
> mediator proxy when the out_only is set to stop the  callback table
> growing, the chaining no longer works ???
>  
> <property action="set" name="OUT_ONLY" value="true"/>
> 
> I am testing this.
> 
> Chaining Example:
> 
> 
> http://adroitlogic.org/knowledge-base-synapse/11-message-chaining-with-synapse.html
> 
> 
> 
> <definitions xmlns="http://ws.apache.org/ns/synapse">
>     <proxy name="StockQuoteProxy">
>         <target>
>             <endpoint>
>                 <address
> uri="http://localhost:9000/soap/SimpleStockQuoteService"/>
>             </endpoint>
>             <outSequence>
>                  <log level="custom">
>                    <property name="LAST PRICE"
> expression="//ns:getQuoteResponse/ns:return/ax:last"
> xmlns:ns="http://services.samples/xsd"
> xmlns:ax="http://services.samples/xsd"/>
>                  </log>
> 
>                  <filter
> xpath="fn:number(//ns:getQuoteResponse/ns:return/ax:last) > 70"
> xmlns:ns="http://services.samples/xsd"
> xmlns:ax="http://services.samples/xsd">
>                    <then>
>                      <log level="custom"><property name="MSG" value="send
> again"/></log>
>                      <script language="js"><![CDATA[
>                            var symbol =
> mc.getPayloadXML()..*::symbol.toString() + "_RETRY";
>                            mc.setPayloadXML(
>                               <m:getQuote
> xmlns:m="http://services.samples/xsd">
>                                  <m:request>
>                                     <m:symbol>{symbol}</m:symbol>
>                                  </m:request>
>                               </m:getQuote>);
>                      ]]></script>
>                      <send>
>                         <endpoint>
>                             <address
> uri="http://localhost:9000/soap/SimpleStockQuoteService"/>
>                         </endpoint>
>                      </send>
>                    </then>
>                    <else>
>                      <log level="custom">
>                         <property name="MSG" value="send reply"/>
>                      </log>
>                      <send/>
>                    </else>
>                  </filter>
>             </outSequence>
>         </target>
>     </proxy>
> </definitions>
> 

-- 
View this message in context: http://www.nabble.com/Chaining-Sample-for-Release-1.3-tp23475248p23475362.html
Sent from the Synapse - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


Mime
View raw message