You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@synapse.apache.org by hi...@apache.org on 2010/11/29 23:34:44 UTC

svn commit: r1040328 - in /synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide: samples.xml samples/sample10.xml samples/sample11.xml samples/sample12.xml samples/sample9.xml

Author: hiranya
Date: Mon Nov 29 22:34:44 2010
New Revision: 1040328

URL: http://svn.apache.org/viewvc?rev=1040328&view=rev
Log:
Samples 10, 11, 12


Modified:
    synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples.xml
    synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample10.xml
    synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample11.xml
    synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample12.xml
    synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample9.xml

Modified: synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples.xml?rev=1040328&r1=1040327&r2=1040328&view=diff
==============================================================================
--- synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples.xml (original)
+++ synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples.xml Mon Nov 29 22:34:44 2010
@@ -46,10 +46,10 @@
                         <li><a href="samples/sample6.html">Sample 6: Manipulating SOAP headers, and filtering incoming and outgoing messages</a></li>
                         <li><a href="samples/sample7.html">Sample 7: Introduction to local registry entries and using schema validation</a></li>
                         <li><a href="samples/sample8.html">Sample 8: Introduction to static and dynamic registry resources, and using XSLT transformations</a></li>
-                        <li><a href="samples/sample9.html">Sample 9: Introduction to dynamic sequences with the registry</a></li>
-                        <li><a href="samples/sample10.html">Sample 10: Introduction to dynamic endpoints with the registry</a></li>
+                        <li><a href="samples/sample9.html">Sample 9: Introduction to dynamic sequences with registry</a></li>
+                        <li><a href="samples/sample10.html">Sample 10: Introduction to dynamic endpoints with registry</a></li>
                         <li><a href="samples/sample11.html">Sample 11: A full registry based configuration, and sharing a configuration between multiple instances</a></li>
-                        <li><a href="samples/sample12.html">Sample 12: One way messaging / fireAndForget through Synapse</a></li>
+                        <li><a href="samples/sample12.html">Sample 12: One-way messaging / fire-and-forget through Synapse</a></li>
                         <li><a href="samples/sample13.html">Sample 13: Dual channel invocation through Synapse</a></li>
                     </ul>
                 </p>

Modified: synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample10.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample10.xml?rev=1040328&r1=1040327&r2=1040328&view=diff
==============================================================================
--- synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample10.xml (original)
+++ synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample10.xml Mon Nov 29 22:34:44 2010
@@ -23,7 +23,7 @@
         <title>Apache Synapse - Sample 10</title>
     </properties>
     <body>
-        <section name="Sample 10: ">
+        <section name="Sample 10: Introduction to Dynamic Endpoints with Registry">
             <div class="xmlConf">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;
 
     &lt;registry provider="org.apache.synapse.registry.url.SimpleURLRegistry"&gt;
@@ -31,10 +31,6 @@
         &lt;parameter name="cachableDuration"&gt;15000&lt;/parameter&gt;
     &lt;/registry&gt;
 
-    &lt;sequence name="foo"&gt;
-        &lt;sequence key="xxx"/&gt;
-    &lt;/sequence&gt;
-
     &lt;sequence name="main"&gt;
         &lt;in&gt;
             &lt;send&gt;
@@ -49,7 +45,8 @@
 &lt;/definitions&gt;</div>
             <subsection name="Objective">
                 <p>
-
+                    Demonstrating the ability to load endpoint definitions dynamically from the
+                    remote registry.
                 </p>
             </subsection>
             <subsection name="Pre-requisites">
@@ -59,6 +56,13 @@
                             Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2
                         </li>
                         <li>
+                            Start another Axis2 server instance on different ports (use the following command)
+                            <div class="command" >
+                                Unix/Linux: sh axis2server.sh -http 9001 -https 9003<br/>
+                                Windows: axis2server.bat  -http 9001 -https 9003
+                            </div>
+                        </li>
+                        <li>
                             Start Synapse using the configuration numbered 10 (repository/conf/sample/synapse_sample_10.xml)
                             <div class="command">
                                 Unix/Linux: sh synapse.sh -sample 10<br/>
@@ -69,11 +73,24 @@
                 </p>
             </subsection>
             <subsection name="Executing the Client">
-                <div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/</div>
-
-                <div class="consoleOutput">Sat Nov 18 21:01:23 IST 2006 SimpleStockQuoteService :: Generating quote for : IBM</div>
-
-                <div class="consoleOutput">Standard :: Stock price = $95.26454380258552</div>
+                <p>
+                    This example introduces dynamic endpoints, where the definition of the endpoint
+                    is stored in the registry. To follow this example execute the stock quote client
+                    as 'ant stockquote..' and see that the message is routed to the SimpleStockQuoteService
+                    on the default Axis2 instance on HTTP port 9000.
+                </p>
+                <div class="command">ant stockquote -Dtrpurl=http://localhost:8280/</div>
+                <p>
+                    Repeat the above command immediately again, and notice that the endpoint is
+                    cached and reused by Synapse - similarly to <a href="sample8.html">sample 8</a>.
+                </p>
+                <p>
+                    Now edit the repository/conf/sample/resources/endpoint/dynamic_endpt_1.xml file
+                    and update the address to 'http://localhost:9001/services/SimpleStockQuoteService'.
+                    After the cached value expires, the Registry loads the new definition of the
+                    endpoint, and then the messages are routed to the second sample Axis2 server on
+                    HTTP port 9001.
+                </p>
             </subsection>
         </section>
         <p><a href="../samples.html">Back to Catalog</a></p>        

Modified: synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample11.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample11.xml?rev=1040328&r1=1040327&r2=1040328&view=diff
==============================================================================
--- synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample11.xml (original)
+++ synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample11.xml Mon Nov 29 22:34:44 2010
@@ -23,7 +23,7 @@
         <title>Apache Synapse - Sample 11</title>
     </properties>
     <body>
-        <section name="Sample 11: ">
+        <section name="Sample 11: A Full Registry based Configuration, and Sharing Configuration Between Multiple Instances">
             <div class="xmlConf">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;
 
     &lt;registry provider="org.apache.synapse.registry.url.SimpleURLRegistry"&gt;
@@ -34,7 +34,10 @@
 &lt;/definitions&gt;</div>
             <subsection name="Objective">
                 <p>
-
+                    Demonstrating the ability of Synapse to load the entire configuration from
+                    a remote registry. This approach can also be used to share a single configuration
+                    between multiple Synapse instances by pointing all the Synapse instances to the
+                    same URL registry.
                 </p>
             </subsection>
             <subsection name="Pre-requisites">
@@ -54,11 +57,32 @@
                 </p>
             </subsection>
             <subsection name="Executing the Client">
+                <p>
+                    This example shows a full registry based Synapse configuration. This makes it
+                    possible to easily start multiple instances of Synapse sharing a single configuration
+                    in a clustered environment. The Synapse configuration of a given node hosting
+                    Synapse simply points to the registry and looks up the actual configuration by
+                    requesting the key 'synapse.xml'. 
+                </p>
+                <p>(Note: Full registry based configuration is not dynamic atleast for the moment -
+                    i.e. it is not reloading itself)</p>
+                <p>
+                    Invoke the client as follows.
+                </p>
                 <div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/</div>
+                <p>
+                    Synapse will generate the following log output.
+                </p>
+                <div class="consoleOutput">[HttpServerWorker-1] INFO LogMediator - message = This is a dynamic Synapse configuration</div>
+                <p>The actual synapse.xml loaded from the registry is: </p>
+                <div class="xmlConf">&lt;!-- a registry based Synapse configuration --&gt;
+&lt;definitions xmlns=&quot;http://synapse.apache.org/ns/2010/04/configuraiton&quot;&gt;
+    &lt;log level=&quot;custom&quot;&gt;
+        &lt;property name=&quot;message&quot; value=&quot;This is a dynamic Synapse configuration $$$&quot;/&gt;
+    &lt;/log&gt;
+    &lt;send/&gt;
+&lt;/definitions&gt;</div>
 
-                <div class="consoleOutput">Sat Nov 18 21:01:23 IST 2006 SimpleStockQuoteService :: Generating quote for : IBM</div>
-
-                <div class="consoleOutput">Standard :: Stock price = $95.26454380258552</div>
             </subsection>
         </section>
         <p><a href="../samples.html">Back to Catalog</a></p>        

Modified: synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample12.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample12.xml?rev=1040328&r1=1040327&r2=1040328&view=diff
==============================================================================
--- synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample12.xml (original)
+++ synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample12.xml Mon Nov 29 22:34:44 2010
@@ -23,36 +23,29 @@
         <title>Apache Synapse - Sample 12</title>
     </properties>
     <body>
-        <section name="Sample 12: ">
-            <div class="xmlConf">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;
-
-    &lt;localEntry key="local-enrty-ep-key"
-                src="file:repository/conf/sample/resources/endpoint/dynamic_endpt_1.xml"/&gt;
-
-    &lt;localEntry key="local-enrty-sequence-key"&gt;
-        &lt;sequence name="dynamic_sequence"&gt;
-            &lt;log level="custom"&gt;
-                &lt;property name="message" value="*** Test Message 1 ***"/&gt;
-            &lt;/log&gt;
-        &lt;/sequence&gt;
-    &lt;/localEntry&gt;
-
-    &lt;sequence name="main"&gt;
-        &lt;in&gt;
-            &lt;sequence key="local-enrty-sequence-key"/&gt;
-            &lt;send&gt;
-                &lt;endpoint key="local-enrty-ep-key"/&gt;
-            &lt;/send&gt;
-        &lt;/in&gt;
-        &lt;out&gt;
-            &lt;send/&gt;
-        &lt;/out&gt;
-    &lt;/sequence&gt;
-
+        <section name="Sample 12: One-way Messaging / Fire-and-Forget Through Synapse">
+            <div class="xmlConf">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;
+
+    &lt;sequence name="main"&gt;
+        &lt;!-- filtering of messages with XPath and regex matches --&gt;
+        &lt;filter source="get-property('To')" regex=".*/StockQuote.*"&gt;
+            &lt;then&gt;
+                &lt;send&gt;
+                    &lt;endpoint&gt;
+                        &lt;address uri="http://localhost:9000/services/SimpleStockQuoteService"/&gt;
+                    &lt;/endpoint&gt;
+                &lt;/send&gt;
+                &lt;drop/&gt;
+            &lt;/then&gt;
+        &lt;/filter&gt;
+        &lt;send/&gt;
+    &lt;/sequence&gt;
+
 &lt;/definitions&gt;</div>
             <subsection name="Objective">
                 <p>
-
+                    Demonstrate the ability to perform one-way invocations (out-only) through
+                    Synapse.
                 </p>
             </subsection>
             <subsection name="Pre-requisites">
@@ -62,21 +55,36 @@
                             Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2
                         </li>
                         <li>
-                            Start Synapse using the configuration numbered 12 (repository/conf/sample/synapse_sample_12.xml)
+                            This sample makes use of the configuration used in <a href="sample1.html">sample 1</a>.
+                            So start Synapse using the configuration numbered 1 (repository/conf/sample/synapse_sample_1.xml)
                             <div class="command">
-                                Unix/Linux: sh synapse.sh -sample 12<br/>
-                                Windows: synapse.bat -sample 12
+                                Unix/Linux: sh synapse.sh -sample 1<br/>
+                                Windows: synapse.bat -sample 1
                             </div>
                         </li>
                     </ul>
                 </p>
             </subsection>
             <subsection name="Executing the Client">
-                <div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/</div>
+                <p>
+                    In this example we will invoke the one-way 'placeOrder' operation on the
+                    SimpleStockQuoteService using the sample client which uses the Axis2
+                    ServiceClient.fireAndForget() API. To send a placeOrder request from the sample
+                    client, execute the following command.
+                </p>
+                <div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/ -Dmode=placeorder</div>
 
-                <div class="consoleOutput">Sat Nov 18 21:01:23 IST 2006 SimpleStockQuoteService :: Generating quote for : IBM</div>
+                <p>
+                    Going through the Axis2 server logs, you will notice the following entry, which
+                    confirms that Axis2 accepted the in-only request.
+                </p>
+                <div class="consoleOutput">SimpleStockQuoteService :: Accepted order for : 7482 stocks of IBM at $ 169.27205579038733</div>
 
-                <div class="consoleOutput">Standard :: Stock price = $95.26454380258552</div>
+                <p>
+                    If you send your client request through TCPmon, you will notice that the
+                    SimpleStockQuoteService replies to Synapse with a HTTP 202 reply, and that Synapse
+                    in turns replies to the client with a HTTP 202 acknowledgment.
+                </p>
             </subsection>
         </section>
         <p><a href="../samples.html">Back to Catalog</a></p>        

Modified: synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample9.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample9.xml?rev=1040328&r1=1040327&r2=1040328&view=diff
==============================================================================
--- synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample9.xml (original)
+++ synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample9.xml Mon Nov 29 22:34:44 2010
@@ -23,7 +23,7 @@
         <title>Apache Synapse - Sample 9</title>
     </properties>
     <body>
-        <section name="Sample 9: Introduction to Dynamic Sequences with the Registry ">
+        <section name="Sample 9: Introduction to Dynamic Sequences with Registry">
             <div class="xmlConf">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;
 
     &lt;registry provider="org.apache.synapse.registry.url.SimpleURLRegistry"&gt;