Author: isudana
Date: Wed Dec 28 16:57:20 2016
New Revision: 1776304

URL: http://svn.apache.org/viewvc?rev=1776304&view=rev
Log:
Apply a patch by Chanaka to fix SYNAPSE-1080

Added:
    
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample15.xml
    
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample16.xml
    
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample17.xml
    
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample59.xml
    
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample61.xml
    
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample62.xml
Removed:
    
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample13.xml
Modified:
    synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples.xml
    
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample14.xml

Modified: 
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples.xml
URL: 
http://svn.apache.org/viewvc/synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples.xml?rev=1776304&r1=1776303&r2=1776304&view=diff
==============================================================================
--- 
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples.xml 
(original)
+++ 
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples.xml 
Wed Dec 28 16:57:20 2016
@@ -50,7 +50,10 @@
                         <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 / fire-and-forget through Synapse</a></li>
-                        <li><a href="samples/sample13.html">Sample 13: Dual 
channel invocation through Synapse</a></li>
+                        <li><a href="samples/sample14.html">Sample 14: 
Sequences and Endpoints as local registry items</a></li>
+                        <li><a href="samples/sample15.html">Sample 15: Message 
Copying and Content Enriching with Enrich Mediator</a></li>
+                        <li><a href="samples/sample16.html">Sample 16: 
Introduction to dynamic and static keys</a></li>
+                        <li><a href="samples/sample17.html">Sample 17: 
Introduction to the payloadFactory mediator</a></li>
                     </ul>
                 </p>
             </subsection>
@@ -66,6 +69,9 @@
                         <li><a href="samples/sample56.html">Sample 56: WSDL 
endpoint</a></li>
                         <li><a href="samples/sample57.html">Sample 57: Dynamic 
load balancing between 3 nodes</a></li>
                         <li><a href="samples/sample58.html">Sample 58: Static 
load balancing between 3 nodes</a></li>
+                        <li><a href="samples/sample59.html">Sample 59: 
Weighted Round-Robin loadbalancing between 3 endpoints</a></li>
+                        <li><a href="samples/sample61.html">Sample 61: Routing 
message to 3 static recipients</a></li>
+                        <li><a href="samples/sample62.html">Sample 62: Routing 
message to dynamic recipients</a></li>
                     </ul>
                 </p>
             </subsection>

Modified: 
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample14.xml
URL: 
http://svn.apache.org/viewvc/synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample14.xml?rev=1776304&r1=1776303&r2=1776304&view=diff
==============================================================================
--- 
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample14.xml
 (original)
+++ 
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample14.xml
 Wed Dec 28 16:57:20 2016
@@ -17,7 +17,7 @@
        </properties>
        <body>
                <section name="Sample 14: Sequences and Endpoints as local 
registry items">
-                       <div class="xmlConf"><pre 
xml:space="preserve">&lt;definitions 
xmlns=&quot;http://ws.apache.org/ns/synapse&quot;
+                       <div class="xmlConf">&lt;definitions 
xmlns=&quot;http://ws.apache.org/ns/synapse&quot;
              xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
              xsi:schemaLocation=&quot;http://ws.apache.org/ns/synapse 
http://synapse.apache.org/ns/2010/04/configuration/synapse_config.xsd&quot;&gt;
 
@@ -44,7 +44,7 @@
         &lt;/out&gt;
     &lt;/sequence&gt;
 
-&lt;/definitions&gt;</pre></div>
+&lt;/definitions&gt;</div>
                        <subsection name="Objective">
                                <p>
                                        Objective: Sequence and Endpoints as 
local registry entries

Added: 
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample15.xml
URL: 
http://svn.apache.org/viewvc/synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample15.xml?rev=1776304&view=auto
==============================================================================
--- 
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample15.xml
 (added)
+++ 
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample15.xml
 Wed Dec 28 16:57:20 2016
@@ -0,0 +1,110 @@
+<?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 15</title>
+    </properties>
+    <body>
+        <section name="Sample 15: Message Copying and Content Enriching with 
Enrich Mediator">
+            <div class="xmlConf">&lt;definitions 
xmlns=&quot;http://synapse.apache.org/ns/2010/04/configuration&quot;&gt;
+    &lt;sequence name=&quot;main&quot;&gt;
+        &lt;in&gt;
+            &lt;enrich&gt;
+                &lt;source type=&quot;custom&quot;
+                        
xpath=&quot;//m0:getQuote/m0:request/m0:symbol/text()&quot;
+                        xmlns:m0=&quot;http://services.samples&quot;/&gt;
+                &lt;target type=&quot;property&quot; 
property=&quot;ORIGINAL_REQ&quot;/&gt;
+            &lt;/enrich&gt;
+            &lt;enrich&gt;
+                &lt;source type=&quot;body&quot;/&gt;
+                &lt;target type=&quot;property&quot; 
property=&quot;REQUEST_PAYLOAD&quot;/&gt;
+            &lt;/enrich&gt;
+
+            &lt;enrich&gt;
+                &lt;source type=&quot;inline&quot; 
key=&quot;init_req&quot;/&gt;
+                &lt;target xmlns:m0=&quot;http://services.samples&quot;
+                        
xpath=&quot;//m0:getQuote/m0:request/m0:symbol/text()&quot;/&gt;
+            &lt;/enrich&gt;
+
+            &lt;send&gt;
+                &lt;endpoint&gt;
+                    &lt;address 
uri=&quot;http://localhost:9000/services/SimpleStockQuoteService&quot;/&gt;
+                &lt;/endpoint&gt;
+            &lt;/send&gt;
+            &lt;drop/&gt;
+        &lt;/in&gt;
+        &lt;out&gt;
+            &lt;header xmlns:urn=&quot;http://synapse.apache.org&quot; 
name=&quot;urn:lastTradeTimestamp&quot; value=&quot;foo&quot;/&gt;
+            &lt;enrich&gt;
+                &lt;source type=&quot;custom&quot;
+                        
xpath=&quot;//ns:getQuoteResponse/ns:return/ax21:lastTradeTimestamp&quot;
+                        xmlns:ns=&quot;http://services.samples&quot;
+                        xmlns:ax21=&quot;http://services.samples/xsd&quot;/&gt;
+                &lt;target 
xmlns:soapenv=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;
+                        xmlns:urn=&quot;http://synapse.apache.org&quot;
+                        
xpath=&quot;/soapenv:Envelope/soapenv:Header/urn:lastTradeTimestamp&quot;/&gt;
+            &lt;/enrich&gt;
+             &lt;log level=&quot;full&quot;/&gt;
+            &lt;log&gt;
+                &lt;property name=&quot;Original Request Symbol&quot; 
expression=&quot;get-property(&#39;ORIGINAL_REQ&#39;)&quot;/&gt;
+                &lt;property name=&quot;Request Payload&quot; 
expression=&quot;get-property(&#39;REQUEST_PAYLOAD&#39;)&quot;/&gt;
+            &lt;/log&gt;
+            &lt;send/&gt;
+        &lt;/out&gt;
+
+    &lt;/sequence&gt;
+    &lt;localEntry key=&quot;init_req&quot;&gt;MSFT&lt;/localEntry&gt;
+    &lt;localEntry key=&quot;price_req&quot;&gt;
+        &lt;m0:symbol 
xmlns:m0=&quot;http://services.samples&quot;&gt;MSFT&lt;/m0:symbol&gt;
+    &lt;/localEntry&gt;
+
+&lt;/definitions&gt;</div>
+            <subsection name="Objective">
+                <p>
+                    Objective: Introduction to Message Copying and Content 
Enriching with Enrich Mediator
+                </p>
+            </subsection>
+
+            <subsection name="Pre-requisites">
+                <p>
+                    <ul>
+                        <li>
+                            Start the Synapse configuration numbered 15: i.e. 
synapse -sample 15
+                        </li>
+                        <li>
+                            Start the Axis2 server and deploy the 
SimpleStockQuoteService if
+                            not already done
+                        </li>
+                    </ul>
+                </p>
+            </subsection>
+            <subsection name="Executing the Client">
+                <p>
+                    Execute the client as follows.
+                </p>
+                <div class="command">ant stockquote 
-Dtrpurl=http://localhost:8280/services/StockQuote</div>
+                <p>This sample demonstrate the various capabilities of Enrich 
Mediator. Inside the in-sequence we store/copy different
+                    parts of the message to properties and just before sending 
the message to the StockQuoteService, we modify the
+                    request value based on the local entry value-init_req. 
Then in the out-sequence, the enrich mediator is used
+                    to enrich a soap header based on the 'lastTradeTimestamp' 
value of the response.
+                </p>
+
+            </subsection>
+
+        </section>
+        <p>
+            <a href="../samples.html">Back to Catalog</a>
+        </p>
+    </body>
+</document>
\ No newline at end of file

Added: 
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample16.xml
URL: 
http://svn.apache.org/viewvc/synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample16.xml?rev=1776304&view=auto
==============================================================================
--- 
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample16.xml
 (added)
+++ 
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample16.xml
 Wed Dec 28 16:57:20 2016
@@ -0,0 +1,94 @@
+<?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 16</title>
+    </properties>
+    <body>
+        <section name="Sample 16: Introduction to dynamic and static registry 
keys">
+            <div class="xmlConf">&lt;definitions 
xmlns="http://ws.apache.org/ns/synapse"&gt;
+
+    &lt;!-- the SimpleURLRegistry allows access to a URL based registry (e.g. 
file:/// or http://) --&gt;
+    &lt;registry provider="org.wso2.carbon.mediation.registry.ESBRegistry"&gt;
+        &lt;!-- the root property of the simple URL registry helps resolve a 
resource URL as root + key --&gt;
+        &lt;parameter 
name="root"&gt;file:repository/samples/resources/&lt;/parameter&gt;
+        &lt;!-- all resources loaded from the URL registry would be cached for 
this number of milli seconds --&gt;
+        &lt;parameter name="cachableDuration"&gt;15000&lt;/parameter&gt;
+    &lt;/registry&gt;
+
+    &lt;sequence name="main"&gt;
+        &lt;in&gt;
+            &lt;!-- define the request processing XSLT resource as a property 
value --&gt;
+            &lt;property name="symbol" value="transform/transform.xslt"/&gt;
+            &lt;!-- {} denotes that this key is a dynamic one and it is not a 
static key --&gt;
+            &lt;!-- use Xpath expression "get-property()" to evaluate real key 
from property --&gt;
+            &lt;xslt key="{get-property('symbol')}"/&gt;
+        &lt;/in&gt;
+        &lt;out&gt;
+            &lt;!-- transform the standard response back into the custom 
format the client expects --&gt;
+            &lt;!-- the key is looked up in the remote registry using a static 
key --&gt;
+            &lt;xslt key="transform/transform_back.xslt"/&gt;
+        &lt;/out&gt;
+        &lt;send/&gt;
+    &lt;/sequence&gt;
+
+&lt;/definitions&gt;</div>
+            <subsection name="Objective">
+                <p>
+                    Objective: Introduction to dynamic and static keys
+                </p>
+            </subsection>
+
+            <subsection name="Pre-requisites">
+                <p>
+                    <ul>
+                        <li>
+                            Start the Synapse configuration numbered 16: i.e. 
synapse -sample 16
+                        </li>
+                        <li>
+                            Start the Axis2 server and deploy the 
SimpleStockQuoteService if
+                            not already done
+                        </li>
+                    </ul>
+                </p>
+            </subsection>
+            <subsection name="Executing the Client">
+                <p>
+                    Execute the client as follows.
+                </p>
+                <div class="command">ant stockquote 
-Dtrpurl=http://localhost:8280/services/StockQuote</div>
+                <p>This Sample demonstrates the use of dynamic keys with 
mediators. XSLT mediator is used as an
+                    example for that and deference between static and dynamic 
usage of keys are shown with that.
+                </p>
+                <p>The first registry resource "transform/transform.xslt" is 
set as a property value. Inside the
+                    XSLT mediator the local property value is lookup using the 
Xpath expression "get-property()".
+                    Likewise any Xpath expression can be enclosed inside "{ }" 
to denote that it is a dynamic key.
+                    Then the mediator will evaluate the real value for that 
expression.
+                </p>
+                <p>The second XSLT resource "transform/transform_back.xslt" is 
used simply as a static key as
+                    usual. It is not included inside "{ }" and because of the 
mediator directly use the static
+                    value as the key.
+                </p>
+                <p>Execute the custom quote client as 'ant stockquote 
-Dmode=customquote' and analys the output
+                    which is similar to the Sample 8.
+                </p>
+
+            </subsection>
+
+        </section>
+        <p>
+            <a href="../samples.html">Back to Catalog</a>
+        </p>
+    </body>
+</document>
\ No newline at end of file

Added: 
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample17.xml
URL: 
http://svn.apache.org/viewvc/synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample17.xml?rev=1776304&view=auto
==============================================================================
--- 
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample17.xml
 (added)
+++ 
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample17.xml
 Wed Dec 28 16:57:20 2016
@@ -0,0 +1,91 @@
+<?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 17</title>
+    </properties>
+    <body>
+        <section name="Sample 17: Introduction to the payloadFactory mediator">
+            <div class="xmlConf">&lt;definitions 
xmlns=&quot;http://ws.apache.org/ns/synapse&quot;&gt;
+&lt;sequence name=&quot;main&quot;&gt;
+    &lt;in&gt;
+        &lt;!-- using payloadFactory mediator to transform the request message 
--&gt;
+        &lt;payloadFactory media-type=&quot;xml&quot;&gt;
+            &lt;format&gt;
+                &lt;m:getQuote xmlns:m=&quot;http://services.samples&quot;&gt;
+                &lt;m:request&gt;
+                &lt;m:symbol&gt;$1&lt;/m:symbol&gt;
+                &lt;/m:request&gt;
+                &lt;/m:getQuote&gt;
+            &lt;/format&gt;
+            &lt;args&gt;
+                &lt;arg xmlns:m0=&quot;http://services.samples&quot; 
expression=&quot;//m0:Code&quot;/&gt;&lt;/args&gt;
+            &lt;/payloadFactory&gt;
+    &lt;/in&gt;
+    &lt;out&gt;
+        &lt;!-- using payloadFactory mediator to transform the response 
message --&gt;
+        &lt;payloadFactory media-type=&quot;xml&quot;&gt;
+            &lt;format&gt;
+                &lt;m:CheckPriceResponse 
xmlns:m=&quot;http://services.samples/xsd&quot;&gt;
+                &lt;m:Code&gt;$1&lt;/m:Code&gt;
+                &lt;m:Price&gt;$2&lt;/m:Price&gt;
+                &lt;/m:CheckPriceResponse&gt;
+            &lt;/format&gt;
+            &lt;args&gt;
+                &lt;arg xmlns:m0=&quot;http://services.samples/xsd&quot; 
expression=&quot;//m0:symbol&quot;/&gt;
+                &lt;arg xmlns:m0=&quot;http://services.samples/xsd&quot; 
expression=&quot;//m0:last&quot;/&gt;
+            &lt;/args&gt;
+        &lt;/payloadFactory&gt;
+    &lt;/out&gt;
+    &lt;send/&gt;
+    &lt;/sequence&gt;
+&lt;/definitions&gt;</div>
+            <subsection name="Objective">
+                <p>
+                    Objective: Introduction to the payloadFactory mediator
+                </p>
+            </subsection>
+
+            <subsection name="Pre-requisites">
+                <p>
+                    <ul>
+                        <li>
+                            Start the Synapse configuration numbered 17: i.e. 
synapse -sample 17
+                        </li>
+                        <li>
+                            Start the Axis2 server and deploy the 
SimpleStockQuoteService if
+                            not already done
+                        </li>
+                    </ul>
+                </p>
+            </subsection>
+            <subsection name="Executing the Client">
+                <p>
+                    Execute the client as follows.
+                </p>
+                <div class="command">ant stockquote 
-Daddurl=http://localhost:9000/services/SimpleStockQuoteService 
-Dtrpurl=http://localhost:8280/ -Dmode=customquote
+                </div>
+                <p>This Sample demonstrates how the PayloadFactory Mediator 
can be used to perform transformations
+                    as an alternative to the XSLT mediator, which is 
demonstrated in Sample 8: Introduction to
+                    Static and Dynamic Registry Resources and Using XSLT 
Transformations
+                </p>
+
+            </subsection>
+
+        </section>
+        <p>
+            <a href="../samples.html">Back to Catalog</a>
+        </p>
+    </body>
+</document>

Added: 
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample59.xml
URL: 
http://svn.apache.org/viewvc/synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample59.xml?rev=1776304&view=auto
==============================================================================
--- 
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample59.xml
 (added)
+++ 
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample59.xml
 Wed Dec 28 16:57:20 2016
@@ -0,0 +1,135 @@
+<?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 59</title>
+    </properties>
+    <body>
+        <section name="Sample 59: Weighted Round-Robin loadbalancing between 3 
endpoints">
+            <div class="xmlConf">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+&lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;
+    &lt;sequence name="main" onError="errorHandler"&gt;
+        &lt;in&gt;
+            &lt;send&gt;
+                &lt;endpoint&gt;
+                    &lt;loadbalance
+                            
algorithm="org.apache.synapse.endpoints.algorithms.WeightedRoundRobin"&gt;
+                        &lt;endpoint&gt;
+                            &lt;address 
uri="http://localhost:9001/services/LBService1"&gt;
+                                &lt;enableAddressing/&gt;
+                                &lt;suspendOnFailure&gt;
+                                    
&lt;initialDuration&gt;20000&lt;/initialDuration&gt;
+                                    
&lt;progressionFactor&gt;1.0&lt;/progressionFactor&gt;
+                                &lt;/suspendOnFailure&gt;
+                            &lt;/address&gt;
+                            &lt;property name="loadbalance.weight" 
value="1"/&gt;
+                        &lt;/endpoint&gt;
+                        &lt;endpoint&gt;
+                            &lt;address 
uri="http://localhost:9002/services/LBService1"&gt;
+                                &lt;enableAddressing/&gt;
+                                &lt;suspendOnFailure&gt;
+                                    
&lt;initialDuration&gt;20000&lt;/initialDuration&gt;
+                                    
&lt;progressionFactor&gt;1.0&lt;/progressionFactor&gt;
+                                &lt;/suspendOnFailure&gt;
+                            &lt;/address&gt;
+                            &lt;property name="loadbalance.weight" 
value="2"/&gt;
+                        &lt;/endpoint&gt;
+                        &lt;endpoint&gt;
+                            &lt;address 
uri="http://localhost:9003/services/LBService1"&gt;
+                                &lt;enableAddressing/&gt;
+                                &lt;suspendOnFailure&gt;
+                                    
&lt;initialDuration&gt;20000&lt;/initialDuration&gt;
+                                    
&lt;progressionFactor&gt;1.0&lt;/progressionFactor&gt;
+                                &lt;/suspendOnFailure&gt;
+                            &lt;/address&gt;
+                            &lt;property name="loadbalance.weight" 
value="3"/&gt;
+                        &lt;/endpoint&gt;
+                    &lt;/loadbalance&gt;
+                &lt;/endpoint&gt;
+            &lt;/send&gt;
+            &lt;drop/&gt;
+        &lt;/in&gt;
+        &lt;out&gt;
+            &lt;send/&gt;
+        &lt;/out&gt;
+    &lt;/sequence&gt;
+    &lt;sequence name="errorHandler"&gt;
+        &lt;makefault response="true"&gt;
+            &lt;code xmlns:tns="http://www.w3.org/2003/05/soap-envelope"; 
value="tns:Receiver"/&gt;
+            &lt;reason value="COULDN'T SEND THE MESSAGE TO THE SERVER."/&gt;
+        &lt;/makefault&gt;
+        &lt;send/&gt;
+    &lt;/sequence&gt;
+&lt;/definitions&gt;</div>
+            <subsection name="Objective">
+                <p>
+                    Objective: Demonstrate the weighted load balancing among a 
set of
+endpoints
+                </p>
+            </subsection>
+            <subsection name="Pre-requisites">
+                <p>
+                    <ul>
+                    <li>Start ESB with sample configuration 59. (i.e. 
wso2esb-samples -sn 59) </li>
+
+                    <li>Deploy the LoadbalanceFailoverService and start three 
instances of sample Axis2 server as mentioned in sample 52.</li>
+
+                    <li>Above configuration sends messages with the weighted 
loadbalance behaviour. Weight of each leaf
+                        address endpoint is defined by integer value of 
"loadbalance.weight" property associated with each endpoint.
+                        If weight of a endpoint is x, x number of requests 
will send to that endpoint before switch to next active endpoint.
+                        <br/>To test this, run the loadbalancefailover client 
to send 100 requests as follows: </li>
+                    </ul>
+                </p>
+            </subsection>
+            <subsection name="Executing the Client">
+                <p>
+                    Invoke the sample client as follows
+                </p>
+                <div class="command">ant loadbalancefailover -Di=100</div>
+                <p>This client sends 100 requests to the 
LoadbalanceFailoverService through
+                    ESB. ESB will distribute the load among the three 
endpoints mentioned in the
+                    configuration in weighted round-robin manner. 
LoadbalanceFailoverService appends the
+                    name of the server to the response, so that client can 
determine which server
+                    has processed the message. If you examine the console 
output of the client,
+                    you can see that requests are processed by three servers 
as follows: </p>
+                <div class="consoleOutput">[java] Request: 1 ==&gt; Response 
from server: MyServer1
+                    [java] Request: 2 ==&gt; Response from server: MyServer2
+                    [java] Request: 3 ==&gt; Response from server: MyServer2
+                    [java] Request: 4 ==&gt; Response from server: MyServer3
+                    [java] Request: 5 ==&gt; Response from server: MyServer3
+                    [java] Request: 6 ==&gt; Response from server: MyServer3
+                    [java] Request: 7 ==&gt; Response from server: MyServer1
+                    [java] Request: 8 ==&gt; Response from server: MyServer2
+                    [java] Request: 9 ==&gt; Response from server: MyServer2
+                    [java] Request: 10 ==&gt; Response from server: MyServer3
+                    [java] Request: 11 ==&gt; Response from server: MyServer3
+                    [java] Request: 12 ==&gt; Response from server: MyServer3
+                    ...
+                </div>
+                <p>As logs, endpoint with weight 1 received a 1 request and 
endpoint with weight 2 received 2
+                    requests and etc... in a cycle</p>
+             </subsection>
+        </section>
+        <p>
+            <a href="../samples.html">Back to Catalog</a>
+        </p>
+    </body>
+</document>

Added: 
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample61.xml
URL: 
http://svn.apache.org/viewvc/synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample61.xml?rev=1776304&view=auto
==============================================================================
--- 
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample61.xml
 (added)
+++ 
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample61.xml
 Wed Dec 28 16:57:20 2016
@@ -0,0 +1,86 @@
+<?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 61</title>
+    </properties>
+    <body>
+        <section name="Sample 61: Routing message to 3 static recipients">
+            <div class="xmlConf">&lt;definitions 
xmlns=&quot;http://ws.apache.org/ns/synapse&quot;&gt;
+   &lt;sequence name=&quot;errorHandler&quot;&gt;
+      &lt;makefault response=&quot;true&quot;&gt;
+         &lt;code 
xmlns:tns=&quot;http://www.w3.org/2003/05/soap-envelope&quot; 
value=&quot;tns:Receiver&quot; /&gt;
+         &lt;reason value=&quot;COULDN&#39;T SEND THE MESSAGE TO THE 
SERVER.&quot; /&gt;
+      &lt;/makefault&gt;
+      &lt;send /&gt;
+   &lt;/sequence&gt;
+   &lt;sequence name=&quot;fault&quot;&gt;
+      &lt;log level=&quot;full&quot;&gt;
+         &lt;property name=&quot;MESSAGE&quot; value=&quot;Executing default 
&amp;quot;fault&amp;quot; sequence&quot; /&gt;
+         &lt;property name=&quot;ERROR_CODE&quot; 
expression=&quot;get-property(&#39;ERROR_CODE&#39;)&quot; /&gt;
+         &lt;property name=&quot;ERROR_MESSAGE&quot; 
expression=&quot;get-property(&#39;ERROR_MESSAGE&#39;)&quot; /&gt;
+      &lt;/log&gt;
+      &lt;drop /&gt;
+   &lt;/sequence&gt;
+   &lt;sequence name=&quot;main&quot; onError=&quot;errorHandler&quot;&gt;
+      &lt;in&gt;
+         &lt;property name=&quot;EP_LIST&quot; 
value=&quot;http://localhost:9001/services/SimpleStockQuoteService,http://localhost:9002/services/SimpleStockQuoteService,http://localhost:9003/services/SimpleStockQuoteService&quot;/&gt;
     
+         &lt;property name=&quot;OUT_ONLY&quot; value=&quot;true&quot; /&gt;
+         &lt;property name=&quot;FORCE_SC_ACCEPTED&quot; 
value=&quot;true&quot; scope=&quot;axis2&quot; /&gt;
+         &lt;send&gt;
+            &lt;endpoint&gt;
+               &lt;recipientlist&gt;
+                  &lt;endpoints 
value=&quot;{get-property(&#39;EP_LIST&#39;)}&quot; max-cache=&quot;20&quot; 
/&gt;
+               &lt;/recipientlist&gt;
+            &lt;/endpoint&gt;
+         &lt;/send&gt;
+         &lt;drop/&gt;
+      &lt;/in&gt;
+   &lt;/sequence&gt;
+&lt;/definitions&gt;</div>
+            <subsection name="Objective">
+                <p>
+                    Objective: Routing message to 3 static recipients
+                </p>
+            </subsection>
+            <subsection name="Pre-requisites">
+                <p>
+                    <ul>
+                        <li>Start ESB with sample configuration 61. (i.e. 
wso2esb-samples -sn 61) </li>
+
+                        <li>Start three instances of the sample Axis2 server 
on HTTP ports 9001, 9002 and 9003 and give unique names to each server. For 
instructions on starting the Axis2 server, see  Starting the Axis2 server </li>
+
+                    </ul>
+                </p>
+            </subsection>
+            <subsection name="Executing the Client">
+                <p>
+                    Invoke the sample client as follows
+                </p>
+                <div class="command">ant stockquote -Dmode=placeorder 
-Dtrpurl=http://localhost:8280/</div>
+                
+            </subsection>
+        </section>
+        <p>
+            <a href="../samples.html">Back to Catalog</a>
+        </p>
+    </body>
+</document>

Added: 
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample62.xml
URL: 
http://svn.apache.org/viewvc/synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample62.xml?rev=1776304&view=auto
==============================================================================
--- 
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample62.xml
 (added)
+++ 
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample62.xml
 Wed Dec 28 16:57:20 2016
@@ -0,0 +1,94 @@
+<?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 62</title>
+    </properties>
+    <body>
+        <section name="Sample 62: Routing message to dynamic recipients">
+            <div class="xmlConf">&lt;definitions 
xmlns=&quot;http://ws.apache.org/ns/synapse&quot;&gt;
+   &lt;sequence name=&quot;errorHandler&quot;&gt;
+      &lt;makefault response=&quot;true&quot;&gt;
+         &lt;code 
xmlns:tns=&quot;http://www.w3.org/2003/05/soap-envelope&quot; 
value=&quot;tns:Receiver&quot; /&gt;
+         &lt;reason value=&quot;COULDN&#39;T SEND THE MESSAGE TO THE 
SERVER.&quot; /&gt;
+      &lt;/makefault&gt;
+      &lt;send /&gt;
+   &lt;/sequence&gt;
+   &lt;sequence name=&quot;fault&quot;&gt;
+      &lt;log level=&quot;full&quot;&gt;
+         &lt;property name=&quot;MESSAGE&quot; value=&quot;Executing default 
&amp;quot;fault&amp;quot; sequence&quot; /&gt;
+         &lt;property name=&quot;ERROR_CODE&quot; 
expression=&quot;get-property(&#39;ERROR_CODE&#39;)&quot; /&gt;
+         &lt;property name=&quot;ERROR_MESSAGE&quot; 
expression=&quot;get-property(&#39;ERROR_MESSAGE&#39;)&quot; /&gt;
+      &lt;/log&gt;
+      &lt;drop /&gt;
+   &lt;/sequence&gt;
+   &lt;sequence name=&quot;main&quot; onError=&quot;errorHandler&quot;&gt;
+      &lt;in&gt;
+         &lt;property name=&quot;EP_LIST&quot; 
value=&quot;http://localhost:9001/services/SimpleStockQuoteService,http://localhost:9002/services/SimpleStockQuoteService,http://localhost:9003/services/SimpleStockQuoteService&quot;/&gt;
     
+         &lt;send&gt;
+            &lt;endpoint&gt;
+               &lt;recipientlist&gt;
+                  &lt;endpoints 
value=&quot;{get-property(&#39;EP_LIST&#39;)}&quot; max-cache=&quot;20&quot; 
/&gt;
+               &lt;/recipientlist&gt;
+            &lt;/endpoint&gt;
+         &lt;/send&gt;
+         &lt;drop/&gt;
+      &lt;/in&gt;
+      &lt;out&gt;
+        &lt;!--Aggregate responses--&gt;
+        &lt;aggregate&gt;
+           &lt;onComplete xmlns:m0=&quot;http://services.samples&quot;
+                          expression=&quot;//m0:getQuoteResponse&quot;&gt;
+             &lt;log level=&quot;full&quot;/&gt;
+             &lt;send/&gt;
+           &lt;/onComplete&gt;
+        &lt;/aggregate&gt;
+      &lt;/out&gt;
+   &lt;/sequence&gt;
+&lt;/definitions&gt;</div>
+            <subsection name="Objective">
+                <p>
+                    Objective: Routing message to dynamic recipients
+                </p>
+            </subsection>
+            <subsection name="Pre-requisites">
+                <p>
+                    <ul>
+                        <li>Start ESB with sample configuration 62. (i.e. 
wso2esb-samples -sn 62) </li>
+
+                        <li>Start three instances of the sample Axis2 server 
on HTTP ports 9001, 9002 and 9003 and give unique names to each server. For 
instructions on starting the Axis2 server, see  Starting the Axis2 server </li>
+
+                    </ul>
+                </p>
+            </subsection>
+            <subsection name="Executing the Client">
+                <p>
+                    Invoke the sample client as follows
+                </p>
+                <div class="command">ant stockquote 
-Dtrpurl=http://localhost:8280/</div>
+                
+            </subsection>
+        </section>
+        <p>
+            <a href="../samples.html">Back to Catalog</a>
+        </p>
+    </body>
+</document>


Reply via email to