Author: hiranya
Date: Mon Aug 10 04:56:52 2009
New Revision: 802647
URL: http://svn.apache.org/viewvc?rev=802647&view=rev
Log:
Adding a sample demonstrating the multi xml configuration builder
Modified:
synapse/trunk/java/src/site/xdoc/Synapse_Samples.xml
Modified: synapse/trunk/java/src/site/xdoc/Synapse_Samples.xml
URL:
http://svn.apache.org/viewvc/synapse/trunk/java/src/site/xdoc/Synapse_Samples.xml?rev=802647&r1=802646&r2=802647&view=diff
==============================================================================
--- synapse/trunk/java/src/site/xdoc/Synapse_Samples.xml (original)
+++ synapse/trunk/java/src/site/xdoc/Synapse_Samples.xml Mon Aug 10 04:56:52
2009
@@ -305,6 +305,14 @@
</li>
</ul>
</li>
+ <li>
+ <a href="#Misc">Miscellaneous Samples</a>
+ <ul>
+ <li>
+ <a href="#Sample600">Sample 600: File hierarchy based
configuration builder</a>
+ </li>
+ </ul>
+ </li>
</ul></div>
<h1>
<a name="MediationSamples" id="MediationSamples">Message Mediation Samples</a>
</h1>
@@ -4235,4 +4243,76 @@
Event publish after transformation.
</p>
</div>
+ <h2>
+ <a name="Sample600" id="Sample600">Sample 600: File hierarchy based
configuration builder</a>
+ </h2>
+ <p>
+  
+ </p>
+ <pre xml:space="preserve">
+ synapse_sample_600.xml
+ |
+ |-- endpoints
+ | `-- foo.xml
+ |-- events
+ | `-- event1.xml
+ |-- local-entries
+ | `-- bar.xml
+ |-- proxy-services
+ | |-- proxy1.xml
+ | |-- proxy2.xml
+ | `-- proxy3.xml
+ |-- registry.xml
+ |-- sequences
+ | |-- custom-logger.xml
+ | |-- fault.xml
+ | `-- main.xml
+ `-- tasks
+ `-- task1.xml
+ </pre>
+ <div>
+ <p>
+ <strong>Objective:</strong> Demonstrate the ability to construct
the Synapse configuration from a file hierarchy
+ </p>
+ <p>
+ <strong>Prerequisites:</strong> Deploy the
+ SimpleStockQuoteService in sample Axis2 server and start it on port
+ 9000.
+ </p>
+ <p>
+ Start Synapse with the sample configuration 600 (i.e. synapse
-sample 600).
+ </p>
+ <p>
+ Go to the SYNAPSE_HOME/repository/conf/sample directory and locate
the subdirectory named synapse_sample_600.xml
+ within it. When Synapse is started with the sample configuration
600, Synapse will load the configuration from
+ this directory. You will find a number of subdirectories and a set
of XML files in each of those directories.
+ Synapse will parse all the XML files in this file hierarchy and
construct the full Synapse configuration at startup.
+ As a result when this sample is executed Synapse will start with
three proxy services, three sequences, a task, an event
+ source and some endpoint and local entry definitions.
+ </p>
+ <p>
+ The names of the subdirectories (eg: proxy-services, sequences,
endpoints) are fixed and hence cannot be changed.
+ Also the registry definition should go into a file named
registry.xml which resides at the top level of the file
+ hierarchy. The files which define proxy services, sequences,
endpoints etc can have any name. These configuration
+ files must have the .xml extension at the end of the name. Synapse
will ignore any files which does not have the
+ .xml extension.
+ </p>
+ <p>
+ None of the directories and files in the sample file hierachy are
mandatory. You can leave entire directories out if
+ you do not need them. For example if your configuration does not
contain any proxy services you can leave the
+ subdirectory named proxy-services out.
+ </p>
+ <p>
+ To use this feature you should simply pass a path to an existing
directory when starting the Synapse server. The
+ SynapseServer class which is responsible for starting the server
accepts a file path as an argument from where to
+ load the configuration. Generally we pass the path to the
synapse.xml file as the value of this argument. If you
+ pass a directory path instead, Synapse configuration will be
loaded from the specified directory. Note the following
+ line on the console when Synapse is loading the configuration from
a file hierarchy.
+ </p>
+ <pre>2009-08-04 14:14:42,489 [-] [main] INFO
SynapseConfigurationBuilder Loaded Synapse configuration from the directory
hierarchy at : /home/synapse/repository/conf/sample/synapse_sample_600.xml</pre>
+ <p>
+ This feature comes in handy when managing large Synapse
configurations. It is easier to maintain a well structured
+ file hierarchy than managing one large flat XML file.
+ </p>
+ </div>
</body></document>