Added: synapse/site/3_0_2/userguide/samples/sample363.html
URL: 
http://svn.apache.org/viewvc/synapse/site/3_0_2/userguide/samples/sample363.html?rev=1909775&view=auto
==============================================================================
--- synapse/site/3_0_2/userguide/samples/sample363.html (added)
+++ synapse/site/3_0_2/userguide/samples/sample363.html Fri May 12 16:09:34 2023
@@ -0,0 +1,300 @@
+<!DOCTYPE html>
+<!--
+ | Generated by Apache Maven Doxia Site Renderer 1.7.4 at 2023-05-04 
+ | Rendered using Apache Maven Fluido Skin 1.6
+-->
+<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
+  <head>
+    <meta charset="UTF-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <meta name="Date-Revision-yyyymmdd" content="20230504" />
+    <meta http-equiv="Content-Language" content="en" />
+    <title>Apache Synapse &#x2013; Apache Synapse - Sample 363</title>
+    <link rel="stylesheet" href="../../css/apache-maven-fluido-1.6.min.css" />
+    <link rel="stylesheet" href="../../css/site.css" />
+    <link rel="stylesheet" href="../../css/print.css" media="print" />
+      <script type="text/javascript" 
src="../../js/apache-maven-fluido-1.6.min.js"></script>
+      </head>
+    <body class="topBarDisabled">
+      <div class="container-fluid">
+      <div id="banner">
+        <div class="pull-left"><div id="bannerLeft"><h2>Apache Synapse</h2>
+</div>
+</div>
+        <div class="pull-right"></div>
+        <div class="clear"><hr/></div>
+      </div>
+
+      <div id="breadcrumbs">
+        <ul class="breadcrumb">
+        <li id="publishDate">Last Published: 2023-05-04<span 
class="divider">|</span>
+</li>
+          <li id="projectVersion">Version: 3.0.2</li>
+        </ul>
+      </div>
+      <div class="row-fluid">
+        <div id="leftColumn" class="span2">
+          <div class="well sidebar-nav">
+<ul class="nav nav-list">
+          <li class="nav-header">Main Menu</li>
+    <li><a href="../../index.html" title="Home"><span 
class="none"></span>Home</a>  </li>
+    <li><a href="../../download.html" title="Download"><span 
class="none"></span>Download</a>  </li>
+    <li><a href="../../history.html" title="History"><span 
class="none"></span>History</a>  </li>
+    <li><a href="http://www.apache.org/licenses/LICENSE-2.0"; 
class="externalLink" title="License"><span class="none"></span>License</a>  
</li>
+    <li><a href="http://www.apache.org/foundation/thanks.html"; 
class="externalLink" title="Thanks"><span class="none"></span>Thanks</a>  </li>
+    <li><a href="http://www.apache.org/foundation/sponsorship.html"; 
class="externalLink" title="Sponsorship"><span 
class="none"></span>Sponsorship</a>  </li>
+    <li><a href="http://www.apache.org/security/"; class="externalLink" 
title="Security"><span class="none"></span>Security</a>  </li>
+          <li class="nav-header">Documentation</li>
+    <li><a href="../../userguide/installation.html" title="Installation 
Guide"><span class="none"></span>Installation Guide</a>  </li>
+    <li><a href="../../userguide/quick_start.html" title="Quick Start 
Guide"><span class="none"></span>Quick Start Guide</a>  </li>
+    <li><a href="../../userguide/samples/setup/index.html" title="Samples 
Setup Guide"><span class="none"></span>Samples Setup Guide</a>  </li>
+    <li><a href="../../userguide/samples.html" title="Samples Catalog"><span 
class="none"></span>Samples Catalog</a>  </li>
+    <li><a href="../../userguide/config.html" title="Configuration 
Language"><span class="none"></span>Configuration Language</a>  </li>
+    <li><a href="../../userguide/mediators.html" title="Mediators 
Catalog"><span class="none"></span>Mediators Catalog</a>  </li>
+    <li><a href="../../userguide/transports.html" title="Transports 
Catalog"><span class="none"></span>Transports Catalog</a>  </li>
+    <li><a href="../../userguide/properties.html" title="Properties 
Catalog"><span class="none"></span>Properties Catalog</a>  </li>
+    <li><a href="../../userguide/xpath.html" title="XPath functions and 
Variables"><span class="none"></span>XPath functions and Variables</a>  </li>
+    <li><a href="../../userguide/extending.html" title="Extending 
Synapse"><span class="none"></span>Extending Synapse</a>  </li>
+    <li><a href="../../userguide/template_library.html" title="Synapse 
Template Libraries"><span class="none"></span>Synapse Template Libraries</a>  
</li>
+    <li><a href="../../userguide/upgrading.html" title="Upgrading"><span 
class="none"></span>Upgrading</a>  </li>
+    <li><a href="../../userguide/deployment.html" title="Deployment"><span 
class="none"></span>Deployment</a>  </li>
+    <li><a href="../../apidocs/" title="Javadocs"><span 
class="none"></span>Javadocs</a>  </li>
+    <li><a href="../../userguide/faq.html" title="FAQ"><span 
class="none"></span>FAQ</a>  </li>
+          <li class="nav-header">Developer Resources</li>
+    <li><a href="../../dev/developer-guide.html" title="Developer Guide"><span 
class="none"></span>Developer Guide</a>  </li>
+    <li><a href="../../dev/best-practices.html" title="Development Best 
Practices"><span class="none"></span>Development Best Practices</a>  </li>
+    <li><a href="../../dev/release-process.html" title="Release Process"><span 
class="none"></span>Release Process</a>  </li>
+          <li class="nav-header">Project Details</li>
+    <li><a href="../../project-info.html" title="Overview"><span 
class="none"></span>Overview</a>  </li>
+    <li><a href="../../mail-lists.html" title="Mailing Lists"><span 
class="none"></span>Mailing Lists</a>  </li>
+    <li><a href="../../source-repository.html" title="Source Repository"><span 
class="none"></span>Source Repository</a>  </li>
+    <li><a href="../../issue-tracking.html" title="Issue Tracking"><span 
class="none"></span>Issue Tracking</a>  </li>
+    <li><a href="../../dependency-management.html" title="Dependencies"><span 
class="none"></span>Dependencies</a>  </li>
+    <li><a href="../../team-list.html" title="Project Team"><span 
class="none"></span>Project Team</a>  </li>
+  </ul>
+          <hr />
+          <div id="poweredBy">
+              <div class="clear"></div>
+              <div class="clear"></div>
+              <div class="clear"></div>
+              <div class="clear"></div>
+  <a href="http://maven.apache.org/"; title="Built by Maven" 
class="poweredBy"><img class="builtBy" alt="Built by Maven" 
src="../../images/logos/maven-feather.png" /></a>
+              </div>
+          </div>
+        </div>
+        <div id="bodyColumn"  class="span10" >
+
+    
+        <div class="section">
+<h2><a name="Sample_363:_Reusable_Database_Connection_Pools"></a>Sample 363: 
Reusable Database Connection Pools</h2>
+            
+<div class="xmlConf">&lt;definitions 
xmlns=&quot;http://ws.apache.org/ns/synapse&quot;&gt;
+
+    &lt;sequence name=&quot;myFaultHandler&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 
expression=&quot;get-property('ERROR_MESSAGE')&quot;/&gt;
+        &lt;/makefault&gt;
+        &lt;send/&gt;
+        &lt;drop/&gt;
+    &lt;/sequence&gt;
+
+    &lt;sequence name=&quot;main&quot; onError=&quot;myFaultHandler&quot;&gt;
+        &lt;in&gt;
+            &lt;log level=&quot;custom&quot;&gt;
+                &lt;property name=&quot;text&quot; value=&quot;** Looking up 
from the Database **&quot;/&gt;
+            &lt;/log&gt;
+            &lt;dblookup&gt;
+                &lt;connection&gt;
+                    &lt;pool&gt;
+                        &lt;dsName&gt;lookupdb&lt;/dsName&gt;
+                    &lt;/pool&gt;
+                &lt;/connection&gt;
+                &lt;statement&gt;
+                    &lt;sql&gt;select * from company where name =?&lt;/sql&gt;
+                    &lt;parameter xmlns:m0=&quot;http://services.samples&quot;
+                               
expression=&quot;//m0:getQuote/m0:request/m0:symbol&quot; 
type=&quot;VARCHAR&quot;/&gt;
+                    &lt;result name=&quot;company_id&quot; 
column=&quot;id&quot;/&gt;
+                &lt;/statement&gt;
+            &lt;/dblookup&gt;
+
+            &lt;switch source=&quot;get-property('company_id')&quot;&gt;
+                &lt;case regex=&quot;c1&quot;&gt;
+                    &lt;log level=&quot;custom&quot;&gt;
+                        &lt;property name=&quot;text&quot;
+                                  expression=&quot;fn:concat('Company ID - 
',get-property('company_id'))&quot;/&gt;
+                    &lt;/log&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;/case&gt;
+                &lt;case regex=&quot;c2&quot;&gt;
+                    &lt;log level=&quot;custom&quot;&gt;
+                        &lt;property name=&quot;text&quot;
+                                  expression=&quot;fn:concat('Company ID - 
',get-property('company_id'))&quot;/&gt;
+                    &lt;/log&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;/case&gt;
+                &lt;case regex=&quot;c3&quot;&gt;
+                    &lt;log level=&quot;custom&quot;&gt;
+                        &lt;property name=&quot;text&quot;
+                                  expression=&quot;fn:concat('Company ID - 
',get-property('company_id'))&quot;/&gt;
+                    &lt;/log&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;/case&gt;
+                &lt;default&gt;
+                    &lt;log level=&quot;custom&quot;&gt;
+                        &lt;property name=&quot;text&quot; value=&quot;** 
Unrecognized Company ID **&quot;/&gt;
+                    &lt;/log&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;** Unrecognized Company ID 
**&quot;/&gt;
+                    &lt;/makefault&gt;
+                    &lt;send/&gt;
+                    &lt;drop/&gt;
+                &lt;/default&gt;
+            &lt;/switch&gt;
+            &lt;drop/&gt;
+        &lt;/in&gt;
+
+        &lt;out&gt;
+            &lt;log level=&quot;custom&quot;&gt;
+                &lt;property name=&quot;text&quot; value=&quot;** Reporting to 
the Database **&quot;/&gt;
+            &lt;/log&gt;
+            &lt;dbreport&gt;
+                &lt;connection&gt;
+                    &lt;pool&gt;
+                        &lt;dsName&gt;reportdb&lt;/dsName&gt;
+                    &lt;/pool&gt;
+                &lt;/connection&gt;
+                &lt;statement&gt;
+                    &lt;sql&gt;update company set price=? where name 
=?&lt;/sql&gt;
+                    &lt;parameter xmlns:m0=&quot;http://services.samples&quot;
+                               
expression=&quot;//m0:return/m0:last/child::text()&quot; 
type=&quot;DOUBLE&quot;/&gt;
+                    &lt;parameter xmlns:m0=&quot;http://services.samples&quot;
+                               
expression=&quot;//m0:return/m0:symbol/child::text()&quot; 
type=&quot;VARCHAR&quot;/&gt;
+                &lt;/statement&gt;
+            &lt;/dbreport&gt;
+            &lt;log level=&quot;custom&quot;&gt;
+                &lt;property name=&quot;text&quot; value=&quot;** Looking up 
from the Database **&quot;/&gt;
+            &lt;/log&gt;
+            &lt;dblookup&gt;
+                &lt;connection&gt;
+                    &lt;pool&gt;
+                        &lt;dsName&gt;reportdb&lt;/dsName&gt;
+                    &lt;/pool&gt;
+                &lt;/connection&gt;
+                &lt;statement&gt;
+                    &lt;sql&gt;select * from company where name =?&lt;/sql&gt;
+                    &lt;parameter xmlns:m0=&quot;http://services.samples&quot;
+                               
expression=&quot;//m0:return/m0:symbol/child::text()&quot; 
type=&quot;VARCHAR&quot;/&gt;
+                    &lt;result name=&quot;stock_price&quot; 
column=&quot;price&quot;/&gt;
+                &lt;/statement&gt;
+            &lt;/dblookup&gt;
+            &lt;log level=&quot;custom&quot;&gt;
+                &lt;property name=&quot;text&quot;
+                          expression=&quot;fn:concat('Stock price - 
',get-property('stock_price'))&quot;/&gt;
+            &lt;/log&gt;
+            &lt;send/&gt;
+
+        &lt;/out&gt;
+
+    &lt;/sequence&gt;
+
+&lt;/definitions&gt;</div>
+            
+<div class="section">
+<h3><a name="Objective"></a>Objective</h3>
+                
+<p>
+                    Demonstrate how to setup reusable connection pools for the 
dblookup and dbreport
+                    mediators
+                </p>
+            </div>
+            
+<div class="section">
+<h3><a name="Pre-requisites"></a>Pre-requisites</h3>
+                
+<p>
+                    </p>
+<ul>
+                        
+<li>
+                            Setup a Derby database and the Synapse data 
sources as described in the
+                            <a href="setup/db.html">database setup guide</a>
+                        </li>
+                        
+<li>
+                            Deploy the SimpleStockQuoteService in the sample 
Axis2 server and start Axis2
+                        </li>
+                        
+<li>
+                            Start Synapse using the configuration numbered 363 
(repository/conf/sample/synapse_sample_363.xml)
+                            
+<div class="command">
+                                Unix/Linux: sh synapse.sh -sample 363<br />
+                                Windows: synapse.bat -sample 363
+                            </div>
+                        </li>
+                    </ul>
+                
+            </div>
+            
+<div class="section">
+<h3><a name="Executing_the_Client"></a>Executing the Client</h3>
+                
+<p>
+                    This sample employs two instances of the dblookup mediator 
and a single instance
+                    of the dbreport mediator. The two dblookup mediators are 
sharing the same database
+                    connection pool named 'lookupdb'. The dbreport mediator 
makes use of a different
+                    connection pool named 'dbreport'. Synapse uses Apache DBCP 
to create and manage
+                    the corresponding data sources and connection pools.
+                </p>
+                
+<p>
+                    Run this sample by invoking the client as follows.
+                </p>
+                
+<div class="command">ant stockquote 
-Daddurl=http://localhost:9000/services/SimpleStockQuoteService 
-Dtrpurl=http://localhost:8280/ -Dsymbol=IBM</div>
+                
+<p>
+                    Synapse will log the following output as it reads from and 
writes to the database.
+                </p>
+                
+<div class="consoleOutput">INFO LogMediator text = ** Looking up from the 
Database ** ...
+INFO LogMediator text = Company ID - c1 ...
+INFO LogMediator text = ** Reporting to the Database ** ...
+INFO LogMediator text = ** Looking up from the Database ** ...
+INFO LogMediator text = Stock price - 183.3635460215262</div>
+            </div>
+        </div>
+        
+<p><a href="../samples.html">Back to Catalog</a></p>        
+    
+
+        </div>
+      </div>
+    </div>
+    <hr/>
+    <footer>
+      <div class="container-fluid">
+        <div class="row-fluid">
+            <p>Copyright &copy;2005&#x2013;2023
+<a href="http://www.apache.org/";>Apache Software Foundation</a>.
+All rights reserved.</p>
+        </div>
+        </div>
+    </footer>
+    </body>
+</html>

Added: synapse/site/3_0_2/userguide/samples/sample364.html
URL: 
http://svn.apache.org/viewvc/synapse/site/3_0_2/userguide/samples/sample364.html?rev=1909775&view=auto
==============================================================================
--- synapse/site/3_0_2/userguide/samples/sample364.html (added)
+++ synapse/site/3_0_2/userguide/samples/sample364.html Fri May 12 16:09:34 2023
@@ -0,0 +1,238 @@
+<!DOCTYPE html>
+<!--
+ | Generated by Apache Maven Doxia Site Renderer 1.7.4 at 2023-05-04 
+ | Rendered using Apache Maven Fluido Skin 1.6
+-->
+<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
+  <head>
+    <meta charset="UTF-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <meta name="Date-Revision-yyyymmdd" content="20230504" />
+    <meta http-equiv="Content-Language" content="en" />
+    <title>Apache Synapse &#x2013; Apache Synapse - Sample 364</title>
+    <link rel="stylesheet" href="../../css/apache-maven-fluido-1.6.min.css" />
+    <link rel="stylesheet" href="../../css/site.css" />
+    <link rel="stylesheet" href="../../css/print.css" media="print" />
+      <script type="text/javascript" 
src="../../js/apache-maven-fluido-1.6.min.js"></script>
+      </head>
+    <body class="topBarDisabled">
+      <div class="container-fluid">
+      <div id="banner">
+        <div class="pull-left"><div id="bannerLeft"><h2>Apache Synapse</h2>
+</div>
+</div>
+        <div class="pull-right"></div>
+        <div class="clear"><hr/></div>
+      </div>
+
+      <div id="breadcrumbs">
+        <ul class="breadcrumb">
+        <li id="publishDate">Last Published: 2023-05-04<span 
class="divider">|</span>
+</li>
+          <li id="projectVersion">Version: 3.0.2</li>
+        </ul>
+      </div>
+      <div class="row-fluid">
+        <div id="leftColumn" class="span2">
+          <div class="well sidebar-nav">
+<ul class="nav nav-list">
+          <li class="nav-header">Main Menu</li>
+    <li><a href="../../index.html" title="Home"><span 
class="none"></span>Home</a>  </li>
+    <li><a href="../../download.html" title="Download"><span 
class="none"></span>Download</a>  </li>
+    <li><a href="../../history.html" title="History"><span 
class="none"></span>History</a>  </li>
+    <li><a href="http://www.apache.org/licenses/LICENSE-2.0"; 
class="externalLink" title="License"><span class="none"></span>License</a>  
</li>
+    <li><a href="http://www.apache.org/foundation/thanks.html"; 
class="externalLink" title="Thanks"><span class="none"></span>Thanks</a>  </li>
+    <li><a href="http://www.apache.org/foundation/sponsorship.html"; 
class="externalLink" title="Sponsorship"><span 
class="none"></span>Sponsorship</a>  </li>
+    <li><a href="http://www.apache.org/security/"; class="externalLink" 
title="Security"><span class="none"></span>Security</a>  </li>
+          <li class="nav-header">Documentation</li>
+    <li><a href="../../userguide/installation.html" title="Installation 
Guide"><span class="none"></span>Installation Guide</a>  </li>
+    <li><a href="../../userguide/quick_start.html" title="Quick Start 
Guide"><span class="none"></span>Quick Start Guide</a>  </li>
+    <li><a href="../../userguide/samples/setup/index.html" title="Samples 
Setup Guide"><span class="none"></span>Samples Setup Guide</a>  </li>
+    <li><a href="../../userguide/samples.html" title="Samples Catalog"><span 
class="none"></span>Samples Catalog</a>  </li>
+    <li><a href="../../userguide/config.html" title="Configuration 
Language"><span class="none"></span>Configuration Language</a>  </li>
+    <li><a href="../../userguide/mediators.html" title="Mediators 
Catalog"><span class="none"></span>Mediators Catalog</a>  </li>
+    <li><a href="../../userguide/transports.html" title="Transports 
Catalog"><span class="none"></span>Transports Catalog</a>  </li>
+    <li><a href="../../userguide/properties.html" title="Properties 
Catalog"><span class="none"></span>Properties Catalog</a>  </li>
+    <li><a href="../../userguide/xpath.html" title="XPath functions and 
Variables"><span class="none"></span>XPath functions and Variables</a>  </li>
+    <li><a href="../../userguide/extending.html" title="Extending 
Synapse"><span class="none"></span>Extending Synapse</a>  </li>
+    <li><a href="../../userguide/template_library.html" title="Synapse 
Template Libraries"><span class="none"></span>Synapse Template Libraries</a>  
</li>
+    <li><a href="../../userguide/upgrading.html" title="Upgrading"><span 
class="none"></span>Upgrading</a>  </li>
+    <li><a href="../../userguide/deployment.html" title="Deployment"><span 
class="none"></span>Deployment</a>  </li>
+    <li><a href="../../apidocs/" title="Javadocs"><span 
class="none"></span>Javadocs</a>  </li>
+    <li><a href="../../userguide/faq.html" title="FAQ"><span 
class="none"></span>FAQ</a>  </li>
+          <li class="nav-header">Developer Resources</li>
+    <li><a href="../../dev/developer-guide.html" title="Developer Guide"><span 
class="none"></span>Developer Guide</a>  </li>
+    <li><a href="../../dev/best-practices.html" title="Development Best 
Practices"><span class="none"></span>Development Best Practices</a>  </li>
+    <li><a href="../../dev/release-process.html" title="Release Process"><span 
class="none"></span>Release Process</a>  </li>
+          <li class="nav-header">Project Details</li>
+    <li><a href="../../project-info.html" title="Overview"><span 
class="none"></span>Overview</a>  </li>
+    <li><a href="../../mail-lists.html" title="Mailing Lists"><span 
class="none"></span>Mailing Lists</a>  </li>
+    <li><a href="../../source-repository.html" title="Source Repository"><span 
class="none"></span>Source Repository</a>  </li>
+    <li><a href="../../issue-tracking.html" title="Issue Tracking"><span 
class="none"></span>Issue Tracking</a>  </li>
+    <li><a href="../../dependency-management.html" title="Dependencies"><span 
class="none"></span>Dependencies</a>  </li>
+    <li><a href="../../team-list.html" title="Project Team"><span 
class="none"></span>Project Team</a>  </li>
+  </ul>
+          <hr />
+          <div id="poweredBy">
+              <div class="clear"></div>
+              <div class="clear"></div>
+              <div class="clear"></div>
+              <div class="clear"></div>
+  <a href="http://maven.apache.org/"; title="Built by Maven" 
class="poweredBy"><img class="builtBy" alt="Built by Maven" 
src="../../images/logos/maven-feather.png" /></a>
+              </div>
+          </div>
+        </div>
+        <div id="bodyColumn"  class="span10" >
+
+    
+        <div class="section">
+<h2><a name="Sample_364:_Executing_Database_Stored_Procedures"></a>Sample 364: 
Executing Database Stored Procedures</h2>
+            
+<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;send&gt;
+                &lt;endpoint&gt;
+                    &lt;address 
uri=&quot;http://localhost:9000/services/SimpleStockQuoteService&quot;/&gt;
+                &lt;/endpoint&gt;
+            &lt;/send&gt;
+        &lt;/in&gt;
+
+        &lt;out&gt;
+            &lt;log level=&quot;custom&quot;&gt;
+                &lt;property name=&quot;text&quot; value=&quot;** Reporting to 
the Database **&quot;/&gt;
+            &lt;/log&gt;
+
+            &lt;dbreport&gt;
+                &lt;connection&gt;
+                    &lt;pool&gt;
+                        &lt;driver&gt;com.mysql.jdbc.Driver&lt;/driver&gt;
+                        
&lt;url&gt;jdbc:mysql://localhost:3306/synapsedb&lt;/url&gt;
+                        &lt;user&gt;user&lt;/user&gt;
+                        &lt;password&gt;password&lt;/password&gt;
+                    &lt;/pool&gt;
+                &lt;/connection&gt;
+                &lt;statement&gt;
+                    &lt;sql&gt;call updateCompany(?,?)&lt;/sql&gt;
+                    &lt;parameter xmlns:m0=&quot;http://services.samples&quot;
+                               
expression=&quot;//m0:return/m0:last/child::text()&quot; 
type=&quot;DOUBLE&quot;/&gt;
+                    &lt;parameter xmlns:m0=&quot;http://services.samples&quot;
+                               
expression=&quot;//m0:return/m0:symbol/child::text()&quot; 
type=&quot;VARCHAR&quot;/&gt;
+                &lt;/statement&gt;
+            &lt;/dbreport&gt;
+            &lt;log level=&quot;custom&quot;&gt;
+                &lt;property name=&quot;text&quot; value=&quot;** Looking up 
from the Database **&quot;/&gt;
+            &lt;/log&gt;
+            &lt;dblookup&gt;
+                &lt;connection&gt;
+                    &lt;pool&gt;
+                        &lt;driver&gt;com.mysql.jdbc.Driver&lt;/driver&gt;
+                        
&lt;url&gt;jdbc:mysql://localhost:3306/synapsedb&lt;/url&gt;
+                        &lt;user&gt;user&lt;/user&gt;
+                        &lt;password&gt;password&lt;/password&gt;
+                    &lt;/pool&gt;
+                &lt;/connection&gt;
+                &lt;statement&gt;
+                    &lt;sql&gt;call getCompany(?)&lt;/sql&gt;
+                    &lt;parameter xmlns:m0=&quot;http://services.samples&quot;
+                               
expression=&quot;//m0:return/m0:symbol/child::text()&quot; 
type=&quot;VARCHAR&quot;/&gt;
+                    &lt;result name=&quot;stock_prize&quot; 
column=&quot;price&quot;/&gt;
+                &lt;/statement&gt;
+            &lt;/dblookup&gt;
+            &lt;log level=&quot;custom&quot;&gt;
+                &lt;property name=&quot;text&quot;
+                          expression=&quot;fn:concat('Stock Prize - 
',get-property('stock_prize'))&quot;/&gt;
+            &lt;/log&gt;
+            &lt;send/&gt;
+        &lt;/out&gt;
+    &lt;/sequence&gt;
+
+&lt;/definitions&gt;</div>
+            
+<div class="section">
+<h3><a name="Objective"></a>Objective</h3>
+                
+<p>
+                    Demonstrate how to invoke a database stored procedure from 
Synapse
+                </p>
+            </div>
+            
+<div class="section">
+<h3><a name="Pre-requisites"></a>Pre-requisites</h3>
+                
+<p>
+                    </p>
+<ul>
+                        
+<li>
+                            Setup a MySQL database as described in the <a 
href="setup/db.html#mysql">database setup guide</a>
+                        </li>
+                        
+<li>
+                            Deploy the SimpleStockQuoteService in the sample 
Axis2 server and start Axis2
+                        </li>
+                        
+<li>
+                            Open the 
repository/conf/sample/synapse_sample_364.xml file and change the
+                            database username, password credentials accordingly
+                        </li>
+                        
+<li>
+                            Start Synapse using the configuration numbered 364 
(repository/conf/sample/synapse_sample_364.xml)
+                            
+<div class="command">
+                                Unix/Linux: sh synapse.sh -sample 364<br />
+                                Windows: synapse.bat -sample 364
+                            </div>
+                        </li>
+                    </ul>
+                
+            </div>
+            
+<div class="section">
+<h3><a name="Executing_the_Client"></a>Executing the Client</h3>
+                
+<p>
+                    This scenario is very similar to <a 
href="sample363.html">sample 363</a>, but makes
+                    use of stored procedures to lookup and update the database 
instead of simple
+                    SQL queries. Note that we are still using the dblookup and 
dbreport mediators
+                    to access the database but the statements are simply 
calling a stored procedure in
+                    MySQL (the syntax to call a stored procedue is database 
engine specific).
+                </p>
+                
+<p>
+                    To try this sample out, invoke the sample client as 
follows.
+                </p>
+                
+<div class="command">ant stockquote 
-Daddurl=http://localhost:9000/services/SimpleStockQuoteService 
-Dtrpurl=http://localhost:8280/ -Dsymbol=IBM</div>
+                
+<p>
+                    Synapse will invoke the two stored procedures as the 
response is mediated back
+                    to the client. You will see the following output on the 
Synapse console.
+                </p>
+                
+<div class="consoleOutput">INFO LogMediator text = ** Looking up from the 
Database ** ...
+INFO LogMediator text = Company ID - c1 ...
+INFO LogMediator text = Stock price - 183.3635460215262</div>
+            </div>
+        </div>
+        
+<p><a href="../samples.html">Back to Catalog</a></p>        
+    
+
+        </div>
+      </div>
+    </div>
+    <hr/>
+    <footer>
+      <div class="container-fluid">
+        <div class="row-fluid">
+            <p>Copyright &copy;2005&#x2013;2023
+<a href="http://www.apache.org/";>Apache Software Foundation</a>.
+All rights reserved.</p>
+        </div>
+        </div>
+    </footer>
+    </body>
+</html>

Added: synapse/site/3_0_2/userguide/samples/sample370.html
URL: 
http://svn.apache.org/viewvc/synapse/site/3_0_2/userguide/samples/sample370.html?rev=1909775&view=auto
==============================================================================
--- synapse/site/3_0_2/userguide/samples/sample370.html (added)
+++ synapse/site/3_0_2/userguide/samples/sample370.html Fri May 12 16:09:34 2023
@@ -0,0 +1,211 @@
+<!DOCTYPE html>
+<!--
+ | Generated by Apache Maven Doxia Site Renderer 1.7.4 at 2023-05-04 
+ | Rendered using Apache Maven Fluido Skin 1.6
+-->
+<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
+  <head>
+    <meta charset="UTF-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <meta name="Date-Revision-yyyymmdd" content="20230504" />
+    <meta http-equiv="Content-Language" content="en" />
+    <title>Apache Synapse &#x2013; Apache Synapse - Sample 370</title>
+    <link rel="stylesheet" href="../../css/apache-maven-fluido-1.6.min.css" />
+    <link rel="stylesheet" href="../../css/site.css" />
+    <link rel="stylesheet" href="../../css/print.css" media="print" />
+      <script type="text/javascript" 
src="../../js/apache-maven-fluido-1.6.min.js"></script>
+      </head>
+    <body class="topBarDisabled">
+      <div class="container-fluid">
+      <div id="banner">
+        <div class="pull-left"><div id="bannerLeft"><h2>Apache Synapse</h2>
+</div>
+</div>
+        <div class="pull-right"></div>
+        <div class="clear"><hr/></div>
+      </div>
+
+      <div id="breadcrumbs">
+        <ul class="breadcrumb">
+        <li id="publishDate">Last Published: 2023-05-04<span 
class="divider">|</span>
+</li>
+          <li id="projectVersion">Version: 3.0.2</li>
+        </ul>
+      </div>
+      <div class="row-fluid">
+        <div id="leftColumn" class="span2">
+          <div class="well sidebar-nav">
+<ul class="nav nav-list">
+          <li class="nav-header">Main Menu</li>
+    <li><a href="../../index.html" title="Home"><span 
class="none"></span>Home</a>  </li>
+    <li><a href="../../download.html" title="Download"><span 
class="none"></span>Download</a>  </li>
+    <li><a href="../../history.html" title="History"><span 
class="none"></span>History</a>  </li>
+    <li><a href="http://www.apache.org/licenses/LICENSE-2.0"; 
class="externalLink" title="License"><span class="none"></span>License</a>  
</li>
+    <li><a href="http://www.apache.org/foundation/thanks.html"; 
class="externalLink" title="Thanks"><span class="none"></span>Thanks</a>  </li>
+    <li><a href="http://www.apache.org/foundation/sponsorship.html"; 
class="externalLink" title="Sponsorship"><span 
class="none"></span>Sponsorship</a>  </li>
+    <li><a href="http://www.apache.org/security/"; class="externalLink" 
title="Security"><span class="none"></span>Security</a>  </li>
+          <li class="nav-header">Documentation</li>
+    <li><a href="../../userguide/installation.html" title="Installation 
Guide"><span class="none"></span>Installation Guide</a>  </li>
+    <li><a href="../../userguide/quick_start.html" title="Quick Start 
Guide"><span class="none"></span>Quick Start Guide</a>  </li>
+    <li><a href="../../userguide/samples/setup/index.html" title="Samples 
Setup Guide"><span class="none"></span>Samples Setup Guide</a>  </li>
+    <li><a href="../../userguide/samples.html" title="Samples Catalog"><span 
class="none"></span>Samples Catalog</a>  </li>
+    <li><a href="../../userguide/config.html" title="Configuration 
Language"><span class="none"></span>Configuration Language</a>  </li>
+    <li><a href="../../userguide/mediators.html" title="Mediators 
Catalog"><span class="none"></span>Mediators Catalog</a>  </li>
+    <li><a href="../../userguide/transports.html" title="Transports 
Catalog"><span class="none"></span>Transports Catalog</a>  </li>
+    <li><a href="../../userguide/properties.html" title="Properties 
Catalog"><span class="none"></span>Properties Catalog</a>  </li>
+    <li><a href="../../userguide/xpath.html" title="XPath functions and 
Variables"><span class="none"></span>XPath functions and Variables</a>  </li>
+    <li><a href="../../userguide/extending.html" title="Extending 
Synapse"><span class="none"></span>Extending Synapse</a>  </li>
+    <li><a href="../../userguide/template_library.html" title="Synapse 
Template Libraries"><span class="none"></span>Synapse Template Libraries</a>  
</li>
+    <li><a href="../../userguide/upgrading.html" title="Upgrading"><span 
class="none"></span>Upgrading</a>  </li>
+    <li><a href="../../userguide/deployment.html" title="Deployment"><span 
class="none"></span>Deployment</a>  </li>
+    <li><a href="../../apidocs/" title="Javadocs"><span 
class="none"></span>Javadocs</a>  </li>
+    <li><a href="../../userguide/faq.html" title="FAQ"><span 
class="none"></span>FAQ</a>  </li>
+          <li class="nav-header">Developer Resources</li>
+    <li><a href="../../dev/developer-guide.html" title="Developer Guide"><span 
class="none"></span>Developer Guide</a>  </li>
+    <li><a href="../../dev/best-practices.html" title="Development Best 
Practices"><span class="none"></span>Development Best Practices</a>  </li>
+    <li><a href="../../dev/release-process.html" title="Release Process"><span 
class="none"></span>Release Process</a>  </li>
+          <li class="nav-header">Project Details</li>
+    <li><a href="../../project-info.html" title="Overview"><span 
class="none"></span>Overview</a>  </li>
+    <li><a href="../../mail-lists.html" title="Mailing Lists"><span 
class="none"></span>Mailing Lists</a>  </li>
+    <li><a href="../../source-repository.html" title="Source Repository"><span 
class="none"></span>Source Repository</a>  </li>
+    <li><a href="../../issue-tracking.html" title="Issue Tracking"><span 
class="none"></span>Issue Tracking</a>  </li>
+    <li><a href="../../dependency-management.html" title="Dependencies"><span 
class="none"></span>Dependencies</a>  </li>
+    <li><a href="../../team-list.html" title="Project Team"><span 
class="none"></span>Project Team</a>  </li>
+  </ul>
+          <hr />
+          <div id="poweredBy">
+              <div class="clear"></div>
+              <div class="clear"></div>
+              <div class="clear"></div>
+              <div class="clear"></div>
+  <a href="http://maven.apache.org/"; title="Built by Maven" 
class="poweredBy"><img class="builtBy" alt="Built by Maven" 
src="../../images/logos/maven-feather.png" /></a>
+              </div>
+          </div>
+        </div>
+        <div id="bodyColumn"  class="span10" >
+
+    
+        <div class="section">
+<h2><a 
name="Sample_370:_Introduction_to_Throttle_Mediator_and_Concurrency_Throttling"></a>Sample
 370: Introduction to Throttle Mediator and Concurrency Throttling</h2>
+            
+<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;throttle id=&quot;A&quot;&gt;
+                &lt;policy&gt;
+                    &lt;!-- define throttle policy --&gt;
+                    &lt;wsp:Policy 
xmlns:wsp=&quot;http://schemas.xmlsoap.org/ws/2004/09/policy&quot;
+                                
xmlns:throttle=&quot;http://www.wso2.org/products/wso2commons/throttle&quot;&gt;
+                        &lt;throttle:ThrottleAssertion&gt;
+                            
&lt;throttle:MaximumConcurrentAccess&gt;10&lt;/throttle:MaximumConcurrentAccess&gt;
+                        &lt;/throttle:ThrottleAssertion&gt;
+                    &lt;/wsp:Policy&gt;
+                &lt;/policy&gt;
+                &lt;onAccept&gt;
+                    &lt;log level=&quot;custom&quot;&gt;
+                        &lt;property name=&quot;text&quot; 
value=&quot;**Access Accept**&quot;/&gt;
+                    &lt;/log&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;/onAccept&gt;
+                &lt;onReject&gt;
+                    &lt;log level=&quot;custom&quot;&gt;
+                        &lt;property name=&quot;text&quot; 
value=&quot;**Access Denied**&quot;/&gt;
+                    &lt;/log&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;**Access Denied**&quot;/&gt;
+                    &lt;/makefault&gt;
+                    &lt;send/&gt;
+                    &lt;drop/&gt;
+                &lt;/onReject&gt;
+            &lt;/throttle&gt;
+        &lt;/in&gt;
+        &lt;out&gt;
+            &lt;throttle id=&quot;A&quot;/&gt;
+            &lt;send/&gt;
+        &lt;/out&gt;
+    &lt;/sequence&gt;
+
+&lt;/definitions&gt;</div>
+            
+<div class="section">
+<h3><a name="Objective"></a>Objective</h3>
+                
+<p>
+                    Showcase the ability of Synapse to throttle incoming 
requests based on the
+                    concurrency level
+                </p>
+            </div>
+            
+<div class="section">
+<h3><a name="Pre-requisites"></a>Pre-requisites</h3>
+                
+<p>
+                    </p>
+<ul>
+                        
+<li>
+                            Deploy the SimpleStockQuoteService in the sample 
Axis2 server and start Axis2
+                        </li>
+                        
+<li>
+                            Start Synapse using the configuration numbered 370 
(repository/conf/sample/synapse_sample_370.xml)
+                            
+<div class="command">
+                                Unix/Linux: sh synapse.sh -sample 370<br />
+                                Windows: synapse.bat -sample 370
+                            </div>
+                        </li>
+                    </ul>
+                
+            </div>
+            
+<div class="section">
+<h3><a name="Executing_the_Client"></a>Executing the Client</h3>
+                
+<p>
+                    Above configuration specifies a throttle mediator inside 
the in mediator.
+                    Therefore, all request messages directed to the main 
sequence will be subjected
+                    to throttling. Throttle mediator has 'policy', 'onAccept' 
and 'onReject' tags at
+                    top level. The 'policy' tag specifies the throttling 
policy for throttling messages.
+                    This sample policy only contains a component called 
'MaximumConcurrentAccess'.
+                    This indicates the maximum number of concurrent requests 
that can pass through
+                    Synapse on a single unit of time. To test concurrency 
throttling, it is required
+                    to send concurrent requests to Synapse. With this 
configuration if Synapse receives
+                    20 requests concurrently from clients, then approximately 
half of those will succeed
+                    while the others being throttled. The client command to 
try this is as follows.
+                </p>
+                
+<div class="command">ant stockquote -Dsymbol=IBM -Dmode=quote 
-Daddurl=http://localhost:8280/</div>
+                
+<p>
+                    It's not that easy to try this sample out using the sample 
Axis2 client. For
+                    better results, consider using a load testing tool like 
Apache Bench or Java Bench.
+                </p>
+            </div>
+        </div>
+        
+<p><a href="../samples.html">Back to Catalog</a></p>        
+    
+
+        </div>
+      </div>
+    </div>
+    <hr/>
+    <footer>
+      <div class="container-fluid">
+        <div class="row-fluid">
+            <p>Copyright &copy;2005&#x2013;2023
+<a href="http://www.apache.org/";>Apache Software Foundation</a>.
+All rights reserved.</p>
+        </div>
+        </div>
+    </footer>
+    </body>
+</html>

Added: synapse/site/3_0_2/userguide/samples/sample371.html
URL: 
http://svn.apache.org/viewvc/synapse/site/3_0_2/userguide/samples/sample371.html?rev=1909775&view=auto
==============================================================================
--- synapse/site/3_0_2/userguide/samples/sample371.html (added)
+++ synapse/site/3_0_2/userguide/samples/sample371.html Fri May 12 16:09:34 2023
@@ -0,0 +1,276 @@
+<!DOCTYPE html>
+<!--
+ | Generated by Apache Maven Doxia Site Renderer 1.7.4 at 2023-05-04 
+ | Rendered using Apache Maven Fluido Skin 1.6
+-->
+<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
+  <head>
+    <meta charset="UTF-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <meta name="Date-Revision-yyyymmdd" content="20230504" />
+    <meta http-equiv="Content-Language" content="en" />
+    <title>Apache Synapse &#x2013; Apache Synapse - Sample 371</title>
+    <link rel="stylesheet" href="../../css/apache-maven-fluido-1.6.min.css" />
+    <link rel="stylesheet" href="../../css/site.css" />
+    <link rel="stylesheet" href="../../css/print.css" media="print" />
+      <script type="text/javascript" 
src="../../js/apache-maven-fluido-1.6.min.js"></script>
+      </head>
+    <body class="topBarDisabled">
+      <div class="container-fluid">
+      <div id="banner">
+        <div class="pull-left"><div id="bannerLeft"><h2>Apache Synapse</h2>
+</div>
+</div>
+        <div class="pull-right"></div>
+        <div class="clear"><hr/></div>
+      </div>
+
+      <div id="breadcrumbs">
+        <ul class="breadcrumb">
+        <li id="publishDate">Last Published: 2023-05-04<span 
class="divider">|</span>
+</li>
+          <li id="projectVersion">Version: 3.0.2</li>
+        </ul>
+      </div>
+      <div class="row-fluid">
+        <div id="leftColumn" class="span2">
+          <div class="well sidebar-nav">
+<ul class="nav nav-list">
+          <li class="nav-header">Main Menu</li>
+    <li><a href="../../index.html" title="Home"><span 
class="none"></span>Home</a>  </li>
+    <li><a href="../../download.html" title="Download"><span 
class="none"></span>Download</a>  </li>
+    <li><a href="../../history.html" title="History"><span 
class="none"></span>History</a>  </li>
+    <li><a href="http://www.apache.org/licenses/LICENSE-2.0"; 
class="externalLink" title="License"><span class="none"></span>License</a>  
</li>
+    <li><a href="http://www.apache.org/foundation/thanks.html"; 
class="externalLink" title="Thanks"><span class="none"></span>Thanks</a>  </li>
+    <li><a href="http://www.apache.org/foundation/sponsorship.html"; 
class="externalLink" title="Sponsorship"><span 
class="none"></span>Sponsorship</a>  </li>
+    <li><a href="http://www.apache.org/security/"; class="externalLink" 
title="Security"><span class="none"></span>Security</a>  </li>
+          <li class="nav-header">Documentation</li>
+    <li><a href="../../userguide/installation.html" title="Installation 
Guide"><span class="none"></span>Installation Guide</a>  </li>
+    <li><a href="../../userguide/quick_start.html" title="Quick Start 
Guide"><span class="none"></span>Quick Start Guide</a>  </li>
+    <li><a href="../../userguide/samples/setup/index.html" title="Samples 
Setup Guide"><span class="none"></span>Samples Setup Guide</a>  </li>
+    <li><a href="../../userguide/samples.html" title="Samples Catalog"><span 
class="none"></span>Samples Catalog</a>  </li>
+    <li><a href="../../userguide/config.html" title="Configuration 
Language"><span class="none"></span>Configuration Language</a>  </li>
+    <li><a href="../../userguide/mediators.html" title="Mediators 
Catalog"><span class="none"></span>Mediators Catalog</a>  </li>
+    <li><a href="../../userguide/transports.html" title="Transports 
Catalog"><span class="none"></span>Transports Catalog</a>  </li>
+    <li><a href="../../userguide/properties.html" title="Properties 
Catalog"><span class="none"></span>Properties Catalog</a>  </li>
+    <li><a href="../../userguide/xpath.html" title="XPath functions and 
Variables"><span class="none"></span>XPath functions and Variables</a>  </li>
+    <li><a href="../../userguide/extending.html" title="Extending 
Synapse"><span class="none"></span>Extending Synapse</a>  </li>
+    <li><a href="../../userguide/template_library.html" title="Synapse 
Template Libraries"><span class="none"></span>Synapse Template Libraries</a>  
</li>
+    <li><a href="../../userguide/upgrading.html" title="Upgrading"><span 
class="none"></span>Upgrading</a>  </li>
+    <li><a href="../../userguide/deployment.html" title="Deployment"><span 
class="none"></span>Deployment</a>  </li>
+    <li><a href="../../apidocs/" title="Javadocs"><span 
class="none"></span>Javadocs</a>  </li>
+    <li><a href="../../userguide/faq.html" title="FAQ"><span 
class="none"></span>FAQ</a>  </li>
+          <li class="nav-header">Developer Resources</li>
+    <li><a href="../../dev/developer-guide.html" title="Developer Guide"><span 
class="none"></span>Developer Guide</a>  </li>
+    <li><a href="../../dev/best-practices.html" title="Development Best 
Practices"><span class="none"></span>Development Best Practices</a>  </li>
+    <li><a href="../../dev/release-process.html" title="Release Process"><span 
class="none"></span>Release Process</a>  </li>
+          <li class="nav-header">Project Details</li>
+    <li><a href="../../project-info.html" title="Overview"><span 
class="none"></span>Overview</a>  </li>
+    <li><a href="../../mail-lists.html" title="Mailing Lists"><span 
class="none"></span>Mailing Lists</a>  </li>
+    <li><a href="../../source-repository.html" title="Source Repository"><span 
class="none"></span>Source Repository</a>  </li>
+    <li><a href="../../issue-tracking.html" title="Issue Tracking"><span 
class="none"></span>Issue Tracking</a>  </li>
+    <li><a href="../../dependency-management.html" title="Dependencies"><span 
class="none"></span>Dependencies</a>  </li>
+    <li><a href="../../team-list.html" title="Project Team"><span 
class="none"></span>Project Team</a>  </li>
+  </ul>
+          <hr />
+          <div id="poweredBy">
+              <div class="clear"></div>
+              <div class="clear"></div>
+              <div class="clear"></div>
+              <div class="clear"></div>
+  <a href="http://maven.apache.org/"; title="Built by Maven" 
class="poweredBy"><img class="builtBy" alt="Built by Maven" 
src="../../images/logos/maven-feather.png" /></a>
+              </div>
+          </div>
+        </div>
+        <div id="bodyColumn"  class="span10" >
+
+    
+        <div class="section">
+<h2><a name="Sample_371:_Restricting_Requests_Based_on_Policies"></a>Sample 
371: Restricting Requests Based on Policies</h2>
+            
+<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;throttle id=&quot;A&quot;&gt;
+                &lt;policy&gt;
+                    &lt;!-- define throttle policy --&gt;
+                    &lt;wsp:Policy 
xmlns:wsp=&quot;http://schemas.xmlsoap.org/ws/2004/09/policy&quot;
+                                
xmlns:throttle=&quot;http://www.wso2.org/products/wso2commons/throttle&quot;&gt;
+                        &lt;throttle:ThrottleAssertion&gt;
+                            &lt;wsp:All&gt;
+                                &lt;throttle:ID 
throttle:type=&quot;IP&quot;&gt;other&lt;/throttle:ID&gt;
+                                &lt;wsp:ExactlyOne&gt;
+                                    &lt;wsp:All&gt;
+                                        
&lt;throttle:MaximumCount&gt;4&lt;/throttle:MaximumCount&gt;
+                                        
&lt;throttle:UnitTime&gt;800000&lt;/throttle:UnitTime&gt;
+                                        &lt;throttle:ProhibitTimePeriod 
wsp:Optional=&quot;true&quot;&gt;10000
+                                        &lt;/throttle:ProhibitTimePeriod&gt;
+                                    &lt;/wsp:All&gt;
+                                    
&lt;throttle:IsAllow&gt;true&lt;/throttle:IsAllow&gt;
+                                &lt;/wsp:ExactlyOne&gt;
+                            &lt;/wsp:All&gt;
+                            &lt;wsp:All&gt;
+                                &lt;throttle:ID 
throttle:type=&quot;IP&quot;&gt;192.168.8.200-192.168.8.222
+                                &lt;/throttle:ID&gt;
+                                &lt;wsp:ExactlyOne&gt;
+                                    &lt;wsp:All&gt;
+                                        
&lt;throttle:MaximumCount&gt;8&lt;/throttle:MaximumCount&gt;
+                                        
&lt;throttle:UnitTime&gt;800000&lt;/throttle:UnitTime&gt;
+                                        &lt;throttle:ProhibitTimePeriod 
wsp:Optional=&quot;true&quot;&gt;10
+                                        &lt;/throttle:ProhibitTimePeriod&gt;
+                                    &lt;/wsp:All&gt;
+                                    
&lt;throttle:IsAllow&gt;true&lt;/throttle:IsAllow&gt;
+                                &lt;/wsp:ExactlyOne&gt;
+                            &lt;/wsp:All&gt;
+                            &lt;wsp:All&gt;
+                                &lt;throttle:ID 
throttle:type=&quot;IP&quot;&gt;192.168.8.201&lt;/throttle:ID&gt;
+                                &lt;wsp:ExactlyOne&gt;
+                                    &lt;wsp:All&gt;
+                                        
&lt;throttle:MaximumCount&gt;200&lt;/throttle:MaximumCount&gt;
+                                        
&lt;throttle:UnitTime&gt;600000&lt;/throttle:UnitTime&gt;
+                                        &lt;throttle:ProhibitTimePeriod 
wsp:Optional=&quot;true&quot;/&gt;
+                                    &lt;/wsp:All&gt;
+                                    
&lt;throttle:IsAllow&gt;true&lt;/throttle:IsAllow&gt;
+                                &lt;/wsp:ExactlyOne&gt;
+                            &lt;/wsp:All&gt;
+                            &lt;wsp:All&gt;
+                                &lt;throttle:ID 
throttle:type=&quot;IP&quot;&gt;192.168.8.198&lt;/throttle:ID&gt;
+                                &lt;wsp:ExactlyOne&gt;
+                                    &lt;wsp:All&gt;
+                                        
&lt;throttle:MaximumCount&gt;50&lt;/throttle:MaximumCount&gt;
+                                        
&lt;throttle:UnitTime&gt;500000&lt;/throttle:UnitTime&gt;
+                                        &lt;throttle:ProhibitTimePeriod 
wsp:Optional=&quot;true&quot;/&gt;
+                                    &lt;/wsp:All&gt;
+                                    
&lt;throttle:IsAllow&gt;true&lt;/throttle:IsAllow&gt;
+                                &lt;/wsp:ExactlyOne&gt;
+                            &lt;/wsp:All&gt;
+                        &lt;/throttle:ThrottleAssertion&gt;
+                    &lt;/wsp:Policy&gt;
+                &lt;/policy&gt;
+                &lt;onAccept&gt;
+                    &lt;log level=&quot;custom&quot;&gt;
+                        &lt;property name=&quot;text&quot; 
value=&quot;**Access Accept**&quot;/&gt;
+                    &lt;/log&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;/onAccept&gt;
+                &lt;onReject&gt;
+                    &lt;log level=&quot;custom&quot;&gt;
+                        &lt;property name=&quot;text&quot; 
value=&quot;**Access Denied**&quot;/&gt;
+                    &lt;/log&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;**Access Denied**&quot;/&gt;
+                    &lt;/makefault&gt;
+                    &lt;send/&gt;
+                    &lt;drop/&gt;
+                &lt;/onReject&gt;
+            &lt;/throttle&gt;
+        &lt;/in&gt;
+        &lt;out&gt;
+            &lt;throttle id=&quot;A&quot;/&gt;
+            &lt;send/&gt;
+        &lt;/out&gt;
+    &lt;/sequence&gt;
+
+&lt;/definitions&gt;</div>
+            
+<div class="section">
+<h3><a name="Objective"></a>Objective</h3>
+                
+<p>
+                    Demonstrate how to throttle incoming requests based on 
complex policies
+                </p>
+            </div>
+            
+<div class="section">
+<h3><a name="Pre-requisites"></a>Pre-requisites</h3>
+                
+<p>
+                    </p>
+<ul>
+                        
+<li>
+                            Deploy the SimpleStockQuoteService in the sample 
Axis2 server and start Axis2
+                        </li>
+                        
+<li>
+                            Start Synapse using the configuration numbered 371 
(repository/conf/sample/synapse_sample_371.xml)
+                            
+<div class="command">
+                                Unix/Linux: sh synapse.sh -sample 371<br />
+                                Windows: synapse.bat -sample 371
+                            </div>
+                        </li>
+                    </ul>
+                
+            </div>
+            
+<div class="section">
+<h3><a name="Executing_the_Client"></a>Executing the Client</h3>
+                
+<p>
+                    Above configuration specifies a throttle mediator inside 
the in mediator.
+                    Therefore, all request messages directed to the main 
sequence will be subjected
+                    to throttling. Throttle mediator has policy, onAccept and 
onReject tags at the
+                    top level. Policy tag specifies the throttling policy 
against which all messages
+                    will be evaluated. It contains some IP address ranges and 
the maximum number of
+                    messages to be allowed for those ranges within a time 
period given in 'UnitTime'
+                    tag. 'ProhibitTimePeriod' tag specifies the time period to 
prohibit further
+                    requests after the received request count exceeds the 
specified time. Now run the
+                    client 5 times repetitively using the following command to 
see how throttling works.
+                </p>
+                
+<div class="command">ant stockquote -Dsymbol=IBM -Dmode=quote 
-Daddurl=http://localhost:8280/</div>
+                
+<p>
+                    For the first four requests you will get the quote prices 
for IBM as follows.
+                </p>
+                
+<div class="consoleOutput">[java] Standard :: Stock price = 
$177.20143371883802</div>
+                
+<p>
+                    Fifth request will not be sent to the Axis2 server and the 
client will receive
+                    the following fault.
+                </p>
+                
+<div class="consoleOutput">[java] org.apache.axis2.AxisFault: **Access 
Denied**</div>
+                
+<p>
+                    Maximum number of requests within 800000 milliseconds is 
specified as 4 for any
+                    server (including localhost) other than the explicitly 
specified ones. Therefore,
+                    our fifth request is denied by the throttle mediator. You 
can verify this by looking
+                    at the Synapse console.
+                </p>
+                
+<div class="consoleOutput">[HttpServerWorker-1] INFO  LogMediator - text = 
**Access Accept**
+[HttpServerWorker-2] INFO  LogMediator - text = **Access Accept**
+[HttpServerWorker-3] INFO  LogMediator - text = **Access Accept**
+[HttpServerWorker-4] INFO  LogMediator - text = **Access Accept**
+[HttpServerWorker-5] INFO  LogMediator - text = **Access Denied**</div>
+            </div>
+        </div>
+        
+<p><a href="../samples.html">Back to Catalog</a></p>        
+    
+
+        </div>
+      </div>
+    </div>
+    <hr/>
+    <footer>
+      <div class="container-fluid">
+        <div class="row-fluid">
+            <p>Copyright &copy;2005&#x2013;2023
+<a href="http://www.apache.org/";>Apache Software Foundation</a>.
+All rights reserved.</p>
+        </div>
+        </div>
+    </footer>
+    </body>
+</html>

Added: synapse/site/3_0_2/userguide/samples/sample372.html
URL: 
http://svn.apache.org/viewvc/synapse/site/3_0_2/userguide/samples/sample372.html?rev=1909775&view=auto
==============================================================================
--- synapse/site/3_0_2/userguide/samples/sample372.html (added)
+++ synapse/site/3_0_2/userguide/samples/sample372.html Fri May 12 16:09:34 2023
@@ -0,0 +1,215 @@
+<!DOCTYPE html>
+<!--
+ | Generated by Apache Maven Doxia Site Renderer 1.7.4 at 2023-05-04 
+ | Rendered using Apache Maven Fluido Skin 1.6
+-->
+<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
+  <head>
+    <meta charset="UTF-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <meta name="Date-Revision-yyyymmdd" content="20230504" />
+    <meta http-equiv="Content-Language" content="en" />
+    <title>Apache Synapse &#x2013; Apache Synapse - Sample 372</title>
+    <link rel="stylesheet" href="../../css/apache-maven-fluido-1.6.min.css" />
+    <link rel="stylesheet" href="../../css/site.css" />
+    <link rel="stylesheet" href="../../css/print.css" media="print" />
+      <script type="text/javascript" 
src="../../js/apache-maven-fluido-1.6.min.js"></script>
+      </head>
+    <body class="topBarDisabled">
+      <div class="container-fluid">
+      <div id="banner">
+        <div class="pull-left"><div id="bannerLeft"><h2>Apache Synapse</h2>
+</div>
+</div>
+        <div class="pull-right"></div>
+        <div class="clear"><hr/></div>
+      </div>
+
+      <div id="breadcrumbs">
+        <ul class="breadcrumb">
+        <li id="publishDate">Last Published: 2023-05-04<span 
class="divider">|</span>
+</li>
+          <li id="projectVersion">Version: 3.0.2</li>
+        </ul>
+      </div>
+      <div class="row-fluid">
+        <div id="leftColumn" class="span2">
+          <div class="well sidebar-nav">
+<ul class="nav nav-list">
+          <li class="nav-header">Main Menu</li>
+    <li><a href="../../index.html" title="Home"><span 
class="none"></span>Home</a>  </li>
+    <li><a href="../../download.html" title="Download"><span 
class="none"></span>Download</a>  </li>
+    <li><a href="../../history.html" title="History"><span 
class="none"></span>History</a>  </li>
+    <li><a href="http://www.apache.org/licenses/LICENSE-2.0"; 
class="externalLink" title="License"><span class="none"></span>License</a>  
</li>
+    <li><a href="http://www.apache.org/foundation/thanks.html"; 
class="externalLink" title="Thanks"><span class="none"></span>Thanks</a>  </li>
+    <li><a href="http://www.apache.org/foundation/sponsorship.html"; 
class="externalLink" title="Sponsorship"><span 
class="none"></span>Sponsorship</a>  </li>
+    <li><a href="http://www.apache.org/security/"; class="externalLink" 
title="Security"><span class="none"></span>Security</a>  </li>
+          <li class="nav-header">Documentation</li>
+    <li><a href="../../userguide/installation.html" title="Installation 
Guide"><span class="none"></span>Installation Guide</a>  </li>
+    <li><a href="../../userguide/quick_start.html" title="Quick Start 
Guide"><span class="none"></span>Quick Start Guide</a>  </li>
+    <li><a href="../../userguide/samples/setup/index.html" title="Samples 
Setup Guide"><span class="none"></span>Samples Setup Guide</a>  </li>
+    <li><a href="../../userguide/samples.html" title="Samples Catalog"><span 
class="none"></span>Samples Catalog</a>  </li>
+    <li><a href="../../userguide/config.html" title="Configuration 
Language"><span class="none"></span>Configuration Language</a>  </li>
+    <li><a href="../../userguide/mediators.html" title="Mediators 
Catalog"><span class="none"></span>Mediators Catalog</a>  </li>
+    <li><a href="../../userguide/transports.html" title="Transports 
Catalog"><span class="none"></span>Transports Catalog</a>  </li>
+    <li><a href="../../userguide/properties.html" title="Properties 
Catalog"><span class="none"></span>Properties Catalog</a>  </li>
+    <li><a href="../../userguide/xpath.html" title="XPath functions and 
Variables"><span class="none"></span>XPath functions and Variables</a>  </li>
+    <li><a href="../../userguide/extending.html" title="Extending 
Synapse"><span class="none"></span>Extending Synapse</a>  </li>
+    <li><a href="../../userguide/template_library.html" title="Synapse 
Template Libraries"><span class="none"></span>Synapse Template Libraries</a>  
</li>
+    <li><a href="../../userguide/upgrading.html" title="Upgrading"><span 
class="none"></span>Upgrading</a>  </li>
+    <li><a href="../../userguide/deployment.html" title="Deployment"><span 
class="none"></span>Deployment</a>  </li>
+    <li><a href="../../apidocs/" title="Javadocs"><span 
class="none"></span>Javadocs</a>  </li>
+    <li><a href="../../userguide/faq.html" title="FAQ"><span 
class="none"></span>FAQ</a>  </li>
+          <li class="nav-header">Developer Resources</li>
+    <li><a href="../../dev/developer-guide.html" title="Developer Guide"><span 
class="none"></span>Developer Guide</a>  </li>
+    <li><a href="../../dev/best-practices.html" title="Development Best 
Practices"><span class="none"></span>Development Best Practices</a>  </li>
+    <li><a href="../../dev/release-process.html" title="Release Process"><span 
class="none"></span>Release Process</a>  </li>
+          <li class="nav-header">Project Details</li>
+    <li><a href="../../project-info.html" title="Overview"><span 
class="none"></span>Overview</a>  </li>
+    <li><a href="../../mail-lists.html" title="Mailing Lists"><span 
class="none"></span>Mailing Lists</a>  </li>
+    <li><a href="../../source-repository.html" title="Source Repository"><span 
class="none"></span>Source Repository</a>  </li>
+    <li><a href="../../issue-tracking.html" title="Issue Tracking"><span 
class="none"></span>Issue Tracking</a>  </li>
+    <li><a href="../../dependency-management.html" title="Dependencies"><span 
class="none"></span>Dependencies</a>  </li>
+    <li><a href="../../team-list.html" title="Project Team"><span 
class="none"></span>Project Team</a>  </li>
+  </ul>
+          <hr />
+          <div id="poweredBy">
+              <div class="clear"></div>
+              <div class="clear"></div>
+              <div class="clear"></div>
+              <div class="clear"></div>
+  <a href="http://maven.apache.org/"; title="Built by Maven" 
class="poweredBy"><img class="builtBy" alt="Built by Maven" 
src="../../images/logos/maven-feather.png" /></a>
+              </div>
+          </div>
+        </div>
+        <div id="bodyColumn"  class="span10" >
+
+    
+        <div class="section">
+<h2><a 
name="Sample_372:_Use_of_Concurrency_Throttling_and_Request_Rate_Based_Throttling"></a>Sample
 372: Use of Concurrency Throttling and Request Rate Based Throttling</h2>
+            
+<div class="xmlConf">&lt;definitions 
xmlns=&quot;http://ws.apache.org/ns/synapse&quot;&gt;
+
+    &lt;registry 
provider=&quot;org.apache.synapse.registry.url.SimpleURLRegistry&quot;&gt;
+        &lt;!-- the root property of the simple URL registry helps resolve a 
resource URL as root + key --&gt;
+        &lt;parameter 
name=&quot;root&quot;&gt;file:repository/&lt;/parameter&gt;
+        &lt;!-- all resources loaded from the URL registry would be cached for 
this number of milli seconds --&gt;
+        &lt;parameter 
name=&quot;cachableDuration&quot;&gt;150000&lt;/parameter&gt;
+    &lt;/registry&gt;
+
+    &lt;sequence name=&quot;onAcceptSequence&quot;&gt;
+        &lt;log level=&quot;custom&quot;&gt;
+            &lt;property name=&quot;text&quot; value=&quot;**Access 
Accept**&quot;/&gt;
+        &lt;/log&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;/sequence&gt;
+
+    &lt;sequence name=&quot;onRejectSequence&quot; trace=&quot;enable&quot;&gt;
+        &lt;log level=&quot;custom&quot;&gt;
+            &lt;property name=&quot;text&quot; value=&quot;**Access 
Denied**&quot;/&gt;
+        &lt;/log&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;**Access Denied**&quot;/&gt;
+        &lt;/makefault&gt;
+        &lt;send/&gt;
+        &lt;drop/&gt;
+    &lt;/sequence&gt;
+
+    &lt;proxy name=&quot;StockQuoteProxy&quot;&gt;
+        &lt;target&gt;
+            &lt;inSequence&gt;
+                &lt;throttle onReject=&quot;onRejectSequence&quot; 
onAccept=&quot;onAcceptSequence&quot; id=&quot;A&quot;&gt;
+                    &lt;policy 
key=&quot;conf/sample/resources/policy/throttle_policy.xml&quot;/&gt;
+                &lt;/throttle&gt;
+            &lt;/inSequence&gt;
+            &lt;outSequence&gt;
+                &lt;throttle id=&quot;A&quot;/&gt;
+                &lt;send/&gt;
+            &lt;/outSequence&gt;
+        &lt;/target&gt;
+        &lt;publishWSDL 
uri=&quot;file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl&quot;/&gt;
+    &lt;/proxy&gt;
+
+&lt;/definitions&gt;</div>
+            
+<div class="section">
+<h3><a name="Objective"></a>Objective</h3>
+                
+<p>
+                    Showcase how to use the concurrency throttling in 
conjunction with request rate
+                    throttling
+                </p>
+            </div>
+            
+<div class="section">
+<h3><a name="Pre-requisites"></a>Pre-requisites</h3>
+                
+<p>
+                    </p>
+<ul>
+                        
+<li>
+                            Deploy the SimpleStockQuoteService in the sample 
Axis2 server and start Axis2
+                        </li>
+                        
+<li>
+                            Start Synapse using the configuration numbered 372 
(repository/conf/sample/synapse_sample_372.xml)
+                            
+<div class="command">
+                                Unix/Linux: sh synapse.sh -sample 372<br />
+                                Windows: synapse.bat -sample 372
+                            </div>
+                        </li>
+                    </ul>
+                
+            </div>
+            
+<div class="section">
+<h3><a name="Executing_the_Client"></a>Executing the Client</h3>
+                
+<p>
+                    This is a combination of <a href="sample370.html">sample 
370</a> and
+                    <a href="sample371.html">sample 371</a>. In this case the 
throttle policy is loaded
+                    from the 'throttle_policy.xml' file which is fetched from 
the registry. To verify
+                    the functionality, it requires running a load test. The 
all enabled request from
+                    the concurrency throttling will be controlled by the 
access rate base throttling
+                    according to the policy.
+                </p>
+                
+<p>
+                    Run the client as follows.
+                </p>
+                
+<div class="command">ant stockquote 
-Daddurl=http://localhost:8280/services/StockQuoteProxy</div>
+                
+<p>
+                    You will get same results as in <a 
href="sample371.html">sample 371</a>. If you
+                    run the load test, results will be different due to the 
effect of concurrency
+                    throttling.
+                </p>                
+            </div>
+        </div>
+        
+<p><a href="../samples.html">Back to Catalog</a></p>        
+    
+
+        </div>
+      </div>
+    </div>
+    <hr/>
+    <footer>
+      <div class="container-fluid">
+        <div class="row-fluid">
+            <p>Copyright &copy;2005&#x2013;2023
+<a href="http://www.apache.org/";>Apache Software Foundation</a>.
+All rights reserved.</p>
+        </div>
+        </div>
+    </footer>
+    </body>
+</html>

Added: synapse/site/3_0_2/userguide/samples/sample380.html
URL: 
http://svn.apache.org/viewvc/synapse/site/3_0_2/userguide/samples/sample380.html?rev=1909775&view=auto
==============================================================================
--- synapse/site/3_0_2/userguide/samples/sample380.html (added)
+++ synapse/site/3_0_2/userguide/samples/sample380.html Fri May 12 16:09:34 2023
@@ -0,0 +1,305 @@
+<!DOCTYPE html>
+<!--
+ | Generated by Apache Maven Doxia Site Renderer 1.7.4 at 2023-05-04 
+ | Rendered using Apache Maven Fluido Skin 1.6
+-->
+<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
+  <head>
+    <meta charset="UTF-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <meta name="Date-Revision-yyyymmdd" content="20230504" />
+    <meta http-equiv="Content-Language" content="en" />
+    <title>Apache Synapse &#x2013; Apache Synapse - Sample 380</title>
+    <link rel="stylesheet" href="../../css/apache-maven-fluido-1.6.min.css" />
+    <link rel="stylesheet" href="../../css/site.css" />
+    <link rel="stylesheet" href="../../css/print.css" media="print" />
+      <script type="text/javascript" 
src="../../js/apache-maven-fluido-1.6.min.js"></script>
+      </head>
+    <body class="topBarDisabled">
+      <div class="container-fluid">
+      <div id="banner">
+        <div class="pull-left"><div id="bannerLeft"><h2>Apache Synapse</h2>
+</div>
+</div>
+        <div class="pull-right"></div>
+        <div class="clear"><hr/></div>
+      </div>
+
+      <div id="breadcrumbs">
+        <ul class="breadcrumb">
+        <li id="publishDate">Last Published: 2023-05-04<span 
class="divider">|</span>
+</li>
+          <li id="projectVersion">Version: 3.0.2</li>
+        </ul>
+      </div>
+      <div class="row-fluid">
+        <div id="leftColumn" class="span2">
+          <div class="well sidebar-nav">
+<ul class="nav nav-list">
+          <li class="nav-header">Main Menu</li>
+    <li><a href="../../index.html" title="Home"><span 
class="none"></span>Home</a>  </li>
+    <li><a href="../../download.html" title="Download"><span 
class="none"></span>Download</a>  </li>
+    <li><a href="../../history.html" title="History"><span 
class="none"></span>History</a>  </li>
+    <li><a href="http://www.apache.org/licenses/LICENSE-2.0"; 
class="externalLink" title="License"><span class="none"></span>License</a>  
</li>
+    <li><a href="http://www.apache.org/foundation/thanks.html"; 
class="externalLink" title="Thanks"><span class="none"></span>Thanks</a>  </li>
+    <li><a href="http://www.apache.org/foundation/sponsorship.html"; 
class="externalLink" title="Sponsorship"><span 
class="none"></span>Sponsorship</a>  </li>
+    <li><a href="http://www.apache.org/security/"; class="externalLink" 
title="Security"><span class="none"></span>Security</a>  </li>
+          <li class="nav-header">Documentation</li>
+    <li><a href="../../userguide/installation.html" title="Installation 
Guide"><span class="none"></span>Installation Guide</a>  </li>
+    <li><a href="../../userguide/quick_start.html" title="Quick Start 
Guide"><span class="none"></span>Quick Start Guide</a>  </li>
+    <li><a href="../../userguide/samples/setup/index.html" title="Samples 
Setup Guide"><span class="none"></span>Samples Setup Guide</a>  </li>
+    <li><a href="../../userguide/samples.html" title="Samples Catalog"><span 
class="none"></span>Samples Catalog</a>  </li>
+    <li><a href="../../userguide/config.html" title="Configuration 
Language"><span class="none"></span>Configuration Language</a>  </li>
+    <li><a href="../../userguide/mediators.html" title="Mediators 
Catalog"><span class="none"></span>Mediators Catalog</a>  </li>
+    <li><a href="../../userguide/transports.html" title="Transports 
Catalog"><span class="none"></span>Transports Catalog</a>  </li>
+    <li><a href="../../userguide/properties.html" title="Properties 
Catalog"><span class="none"></span>Properties Catalog</a>  </li>
+    <li><a href="../../userguide/xpath.html" title="XPath functions and 
Variables"><span class="none"></span>XPath functions and Variables</a>  </li>
+    <li><a href="../../userguide/extending.html" title="Extending 
Synapse"><span class="none"></span>Extending Synapse</a>  </li>
+    <li><a href="../../userguide/template_library.html" title="Synapse 
Template Libraries"><span class="none"></span>Synapse Template Libraries</a>  
</li>
+    <li><a href="../../userguide/upgrading.html" title="Upgrading"><span 
class="none"></span>Upgrading</a>  </li>
+    <li><a href="../../userguide/deployment.html" title="Deployment"><span 
class="none"></span>Deployment</a>  </li>
+    <li><a href="../../apidocs/" title="Javadocs"><span 
class="none"></span>Javadocs</a>  </li>
+    <li><a href="../../userguide/faq.html" title="FAQ"><span 
class="none"></span>FAQ</a>  </li>
+          <li class="nav-header">Developer Resources</li>
+    <li><a href="../../dev/developer-guide.html" title="Developer Guide"><span 
class="none"></span>Developer Guide</a>  </li>
+    <li><a href="../../dev/best-practices.html" title="Development Best 
Practices"><span class="none"></span>Development Best Practices</a>  </li>
+    <li><a href="../../dev/release-process.html" title="Release Process"><span 
class="none"></span>Release Process</a>  </li>
+          <li class="nav-header">Project Details</li>
+    <li><a href="../../project-info.html" title="Overview"><span 
class="none"></span>Overview</a>  </li>
+    <li><a href="../../mail-lists.html" title="Mailing Lists"><span 
class="none"></span>Mailing Lists</a>  </li>
+    <li><a href="../../source-repository.html" title="Source Repository"><span 
class="none"></span>Source Repository</a>  </li>
+    <li><a href="../../issue-tracking.html" title="Issue Tracking"><span 
class="none"></span>Issue Tracking</a>  </li>
+    <li><a href="../../dependency-management.html" title="Dependencies"><span 
class="none"></span>Dependencies</a>  </li>
+    <li><a href="../../team-list.html" title="Project Team"><span 
class="none"></span>Project Team</a>  </li>
+  </ul>
+          <hr />
+          <div id="poweredBy">
+              <div class="clear"></div>
+              <div class="clear"></div>
+              <div class="clear"></div>
+              <div class="clear"></div>
+  <a href="http://maven.apache.org/"; title="Built by Maven" 
class="poweredBy"><img class="builtBy" alt="Built by Maven" 
src="../../images/logos/maven-feather.png" /></a>
+              </div>
+          </div>
+        </div>
+        <div id="bodyColumn"  class="span10" >
+
+    
+        <div class="section">
+<h2><a name="Sample_380:_Writing_Custom_Mediation_Logic_in_Java"></a>Sample 
380: Writing Custom Mediation Logic in Java</h2>
+            
+<div class="xmlConf">&lt;definitions 
xmlns=&quot;http://ws.apache.org/ns/synapse&quot;&gt;
+
+    &lt;sequence name=&quot;fault&quot;&gt;
+        &lt;makefault&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;Mediation failed.&quot;/&gt;
+        &lt;/makefault&gt;
+        &lt;send/&gt;
+    &lt;/sequence&gt;
+
+    &lt;sequence name=&quot;main&quot; onError=&quot;fault&quot;&gt;
+        &lt;in&gt;
+            &lt;send&gt;
+                &lt;endpoint name=&quot;stockquote&quot;&gt;
+                    &lt;address 
uri=&quot;http://localhost:9000/services/SimpleStockQuoteService&quot;/&gt;
+                &lt;/endpoint&gt;
+            &lt;/send&gt;
+        &lt;/in&gt;
+        &lt;out&gt;
+            &lt;class 
name=&quot;samples.mediators.DiscountQuoteMediator&quot;&gt;
+                &lt;property name=&quot;discountFactor&quot; 
value=&quot;10&quot;/&gt;
+                &lt;property name=&quot;bonusFor&quot; value=&quot;5&quot;/&gt;
+            &lt;/class&gt;
+            &lt;send/&gt;
+        &lt;/out&gt;
+    &lt;/sequence&gt;
+
+&lt;/definitions&gt;</div>
+            
+<div class="section">
+<h3><a name="Objective"></a>Objective</h3>
+                
+<p>
+                    Demonstrate the use of class mediator to extend the 
mediation functionality of
+                    Synapse
+                </p>
+            </div>
+            
+<div class="section">
+<h3><a name="Pre-requisites"></a>Pre-requisites</h3>
+                
+<p>
+                    </p>
+<ul>
+                        
+<li>
+                            Deploy the SimpleStockQuoteService in the sample 
Axis2 server and start Axis2
+                        </li>
+                        
+<li>
+                            Start Synapse using the configuration numbered 380 
(repository/conf/sample/synapse_sample_380.xml)
+                            
+<div class="command">
+                                Unix/Linux: sh synapse.sh -sample 380<br />
+                                Windows: synapse.bat -sample 380
+                            </div>
+                        </li>
+                    </ul>
+                
+            </div>
+            
+<div class="section">
+<h3><a name="Executing_the_Client"></a>Executing the Client</h3>
+                
+<p>
+                    In this configuration, Synapse hands over the request 
message to the specified
+                    endpoint, which sends it to the Axis2 server running on 
port 9000. But the response
+                    message is passed through the class mediator before 
sending it back to the client.
+                    Class mediator in turns hands over the message to the 
specified Java class for
+                    further processing. In that regard, the class mediator 
acts as a delegating
+                    mediator which delegates the message to a custom Java 
class for processing.
+                    Two parameters named 'discountFactor' and 'bonusFor' are 
passed to the mediator
+                    implementation class (i.e. 
samples.mediators.DiscountQuoteMediator) before each
+                    invocation. Source of the mediator implementation class is 
shown below. 
+                </p>
+                
+<div class="consoleOutput">package samples.mediators;
+
+import org.apache.synapse.MessageContext;
+import org.apache.synapse.Mediator;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.soap.SOAPFactory;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.xml.namespace.QName;
+
+public class DiscountQuoteMediator implements Mediator {
+
+    private static final Log log = 
LogFactory.getLog(DiscountQuoteMediator.class);
+
+    private String discountFactor=&quot;10&quot;;
+
+    private String bonusFor=&quot;10&quot;;
+
+    private int bonusCount=0;
+
+    public DiscountQuoteMediator(){}
+
+    public boolean mediate(MessageContext mc) {
+
+        String price= 
mc.getEnvelope().getBody().getFirstElement().getFirstElement().
+                getFirstChildWithName(new 
QName(&quot;http://services.samples&quot;,&quot;last&quot;)).getText();
+
+        //converting String properties into integers
+        int discount=Integer.parseInt(discountFactor);
+        int bonusNo=Integer.parseInt(bonusFor);
+        double currentPrice=Double.parseDouble(price);
+
+        //discounting factor is deducted from current price form every response
+        Double lastPrice = new Double(currentPrice - currentPrice * discount / 
100);
+
+        //Special discount of 5% offers for the first responses as set in the 
bonusFor property
+        if (bonusCount &lt;= bonusNo) {
+            lastPrice = new Double(lastPrice.doubleValue() - 
lastPrice.doubleValue() * 0.05);
+            bonusCount++;
+        }
+
+        String discountedPrice = lastPrice.toString();
+
+        
mc.getEnvelope().getBody().getFirstElement().getFirstElement().getFirstChildWithName
+                (new 
QName(&quot;http://services.samples&quot;,&quot;last&quot;)).setText(discountedPrice);
+
+        System.out.println(&quot;Quote value discounted.&quot;);
+        System.out.println(&quot;Original price: &quot; + price);
+        System.out.println(&quot;Discounted price: &quot; + discountedPrice);
+
+        return true;
+    }
+
+    public String getType() {
+        return null;
+    }
+
+    public void setTraceState(int traceState) {
+        traceState = 0;
+    }
+
+    public int getTraceState() {
+        return 0;
+    }
+
+    public void setDiscountFactor(String discount) {
+        discountFactor=discount;
+    }
+
+    public String getDiscountFactor() {
+        return discountFactor;
+    }
+
+    public void setBonusFor(String bonus){
+        bonusFor=bonus;
+    }
+
+    public String getBonusFor(){
+        return bonusFor;
+    }
+}</div>
+                
+<p>
+                    All classes developed for the class mediator should 
implement the 'Mediator'
+                    interface, which contains the mediate(...) method. The 
mediate(...) method of the
+                    above class is invoked for each response message mediated 
through the main
+                    sequence, with the message context of the current message 
as the parameter. All
+                    details of the message including the SOAP headers, SOAP 
body and properties of
+                    the context hierarchy can be accessed from the message 
context. In this sample,
+                    the body of the message is retrieved and the discount 
percentage is subtracted
+                    from the quote price. If the quote request number is less 
than the number specified
+                    in the 'bonusFor' property in the configuration, a special 
discount is given.
+                </p>
+                
+<p>
+                    To test the custom code and the class mediator, invoke the 
test client as
+                    follows.
+                </p>
+                
+<div class="command">ant stockquote -Dsymbol=IBM -Dmode=quote 
-Daddurl=http://localhost:8280</div>
+                
+<p>
+                    You will see the below output in the client console with 
the discounted quote value.
+                </p>
+                
+<div class="consoleOutput">Standard :: Stock price = $95.26454380258552</div>
+                
+<p>
+                    If you check the Synapse console, you will notice the 
messages printed by the
+                    custom mediator during mediation.
+                </p>
+                
+<div class="consoleOutput">Quote value discounted.
+Original price: 162.30945327447262
+Discounted price: 138.77458254967408</div>
+            </div>
+        </div>
+        
+<p><a href="../samples.html">Back to Catalog</a></p>        
+    
+
+        </div>
+      </div>
+    </div>
+    <hr/>
+    <footer>
+      <div class="container-fluid">
+        <div class="row-fluid">
+            <p>Copyright &copy;2005&#x2013;2023
+<a href="http://www.apache.org/";>Apache Software Foundation</a>.
+All rights reserved.</p>
+        </div>
+        </div>
+    </footer>
+    </body>
+</html>


Reply via email to