Author: hiranya
Date: Sun Nov 28 04:25:04 2010
New Revision: 1039833

URL: http://svn.apache.org/viewvc?rev=1039833&view=rev
Log:
Sample 9


Modified:
    synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples.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=1039833&r1=1039832&r2=1039833&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 
Sun Nov 28 04:25:04 2010
@@ -43,14 +43,14 @@
                         <li><a href="samples/sample3.html">Sample 3: Local 
Registry entry definitions, reusable endpoints and sequences</a></li>
                         <li><a href="samples/sample4.html">Sample 4: 
Introduction to error handling</a></li>
                         <li><a href="samples/sample5.html">Sample 5: Creating 
SOAP fault messages and changing the direction of a message</a></li>
-                        <li><a href="">Sample 6: Manipulating SOAP headers, 
and filtering incoming and outgoing messages</a></li>
-                        <li><a href="">Sample 7: Introduction to local 
Registry entries and using Schema validation</a></li>
-                        <li><a href="">Sample 8: Introduction to static and 
dynamic registry resources, and using XSLT transformations</a></li>
-                        <li><a href="">Sample 9: Introduction to dynamic 
sequences with the Registry</a></li>
-                        <li><a href="">Sample 10: Introduction to dynamic 
endpoints with the Registry</a></li>
-                        <li><a href="">Sample 11: A full registry based 
configuration, and sharing a configuration between multiple instances</a></li>
-                        <li><a href="">Sample 12: One way messaging / 
fireAndForget through Synapse</a></li>
-                        <li><a href="">Sample 13: Dual channel invocation 
through Synapse</a></li>
+                        <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/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/sample13.html">Sample 13: Dual 
channel invocation through Synapse</a></li>
                     </ul>
                 </p>
             </subsection>

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=1039833&r1=1039832&r2=1039833&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
 Sun Nov 28 04:25:04 2010
@@ -23,7 +23,7 @@
         <title>Apache Synapse - Sample 9</title>
     </properties>
     <body>
-        <section name="Sample 9: ">
+        <section name="Sample 9: Introduction to Dynamic Sequences with the 
Registry ">
             <div class="xmlConf">&lt;definitions 
xmlns="http://ws.apache.org/ns/synapse"&gt;
 
     &lt;registry 
provider="org.apache.synapse.registry.url.SimpleURLRegistry"&gt;
@@ -38,7 +38,8 @@
 &lt;/definitions&gt;</div>
             <subsection name="Objective">
                 <p>
-
+                    Demonstrating the ability to load sequence definitions 
dynamically from the
+                    remote registry.
                 </p>
             </subsection>
             <subsection name="Pre-requisites">
@@ -58,11 +59,50 @@
                 </p>
             </subsection>
             <subsection name="Executing the Client">
+                <p>
+                    This example demonstrates the dynamic behaviour of Synapse 
through the use of a
+                    registry. Synapse supports dynamic definitions for 
sequences and endpoints, and
+                    as seen before, for configuration resources (eg: schema 
files, XSLT files etc).
+                    In this example we define a Synapse configuration which 
references a sequence
+                    definition specified as a registry key. The registry key 
resolves to the actual
+                    content of the sequence which would be loaded dynamically 
by Synapse at runtime,
+                    and cached appropriately as per its definition in the 
registry. Once the cache
+                    expires, Synapse would re-check the meta information for 
the definition and
+                    re-load the sequence definition if necessary and re-cache 
it again.
+                </p>
+                <p>
+                    Execute the client as follows.
+                </p>
                 <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>
+                    Go through the mediation debug logs to see how Synapse has 
dynamically loaded
+                    the sequence configurations from the registry.
+                </p>
+                <div class="consoleOutput">[HttpServerWorker-1] DEBUG  
SimpleURLRegistry - ==&gt; Repository fetch of resource with key : 
sequence/dynamic_seq_1.xml
+...
+[HttpServerWorker-1] DEBUG SequenceMediator - Sequence mediator 
&lt;dynamic_sequence&gt; :: mediate()
+...
+[HttpServerWorker-1] INFO  LogMediator - message = *** Test Message 1 ***</div>
+                <p>
+                    Now if you execute the client immediately (i.e. within 15 
seconds of the last
+                    execution) you will notice that the sequence is not 
reloaded. If you edit the
+                    sequence definition in 
repository/conf/sample/resources/sequence/dynamic_seq_1.xml
+                    (i.e. edit the log message to read as '*** Test Message 2 
***') and execute the
+                    client again, you will notice that the new message is not 
yet visible (i.e. if
+                    you execute this within 15 seconds of loading the resource 
for the first time).
+                    However, after 15 seconds elapsed since the original 
caching of the sequence,
+                    you will notice that the new sequence is loaded and 
executed by Synapse from the
+                    following log messages.
+                </p>
+                <div class="consoleOutput">[HttpServerWorker-1] DEBUG  
SimpleURLRegistry - ==&gt; Repository fetch of resource with key : 
sequence/dynamic_seq_1.xml
+...
+[HttpServerWorker-1] DEBUG SequenceMediator - Sequence mediator 
&lt;dynamic_sequence&gt; :: mediate()
+...
+[HttpServerWorker-1] INFO  LogMediator - message = *** Test Message 2 ***</div>
+                <p>
+                    The cache timeout could be tuned appropriately by 
configuring the URL registry
+                    to suit the environment and the needs.
+                </p>
             </subsection>
         </section>
         <p><a href="../samples.html">Back to Catalog</a></p>        


Reply via email to