| <?xml version="1.0" encoding="ISO-8859-1" ?> |
| <!-- |
| ~ Licensed to the Apache Software Foundation (ASF) under one |
| ~ or more contributor license agreements. See the NOTICE file |
| ~ distributed with this work for additional information |
| ~ regarding copyright ownership. The ASF licenses this file |
| ~ to you under the Apache License, Version 2.0 (the |
| ~ "License"); you may not use this file except in compliance |
| ~ with the License. You may obtain a copy of the License at |
| ~ |
| ~ http://www.apache.org/licenses/LICENSE-2.0 |
| ~ |
| ~ Unless required by applicable law or agreed to in writing, |
| ~ software distributed under the License is distributed on an |
| ~ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| ~ KIND, either express or implied. See the License for the |
| ~ specific language governing permissions and limitations |
| ~ under the License. |
| --> |
| |
| <document> |
| <properties> |
| <title>Apache Synapse - Sample 11</title> |
| </properties> |
| <body> |
| <section name="Sample 11: A Full Registry based Configuration, and Sharing Configuration Between Multiple Instances"> |
| <div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse"> |
| |
| <registry provider="org.apache.synapse.registry.url.SimpleURLRegistry"> |
| <parameter name="root">file:./repository/conf/sample/resources/</parameter> |
| <parameter name="cachableDuration">15000</parameter> |
| </registry> |
| |
| </definitions></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"> |
| <p> |
| <ul> |
| <li> |
| Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2 |
| </li> |
| <li> |
| Start Synapse using the configuration numbered 11 (repository/conf/sample/synapse_sample_11.xml) |
| <div class="command"> |
| Unix/Linux: sh synapse.sh -sample 11<br/> |
| Windows: synapse.bat -sample 11 |
| </div> |
| </li> |
| </ul> |
| </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"><!-- a registry based Synapse configuration --> |
| <definitions xmlns="http://synapse.apache.org/ns/2010/04/configuraiton"> |
| <log level="custom"> |
| <property name="message" value="This is a dynamic Synapse configuration $$$"/> |
| </log> |
| <send/> |
| </definitions></div> |
| |
| </subsection> |
| </section> |
| <p><a href="../samples.html">Back to Catalog</a></p> |
| </body> |
| </document> |