Added: synapse/site/3_0_2/userguide/samples/sample854.html URL: http://svn.apache.org/viewvc/synapse/site/3_0_2/userguide/samples/sample854.html?rev=1909775&view=auto ============================================================================== --- synapse/site/3_0_2/userguide/samples/sample854.html (added) +++ synapse/site/3_0_2/userguide/samples/sample854.html Fri May 12 16:09:34 2023 @@ -0,0 +1,167 @@ +<!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 – Apache Synapse - Sample 854</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_854:_Introduction_to_Synapse_Wire_Tap_eip_function_template"></a>Sample 854: Introduction to Synapse Wire Tap eip function template</h2> + +<div class="xmlConf"><!-- Introduction to Synapse Wire Tap eip function template --> +<definitions xmlns="http://ws.apache.org/ns/synapse"> +<import xmlns="http://ws.apache.org/ns/synapse" name="EipLibrary" package="synapse.lang.eip" /> + <sequence name="main"> +<property name="OUT_ONLY" value="true"/> + <property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/> + <call-template target="synapse.lang.eip.wire_tap"> +<with-param name="wiretap_uri" value="http://localhost:9000/services/SimpleStockQuoteService"/> + <with-param name="destination_uri" value="http://localhost:9001/services/SimpleStockQuoteService"/> + </call-template> + </sequence> +</definitions></div> + +<div class="section"> +<h3><a name="Objective"></a>Objective</h3> + +<p> +This sample is an introduction to Synapse Wire Tap eip function template. + </p> + </div> + +<div class="section"> +<h3><a name="Pre-requisites"></a>Pre-requisites</h3> + +<p> + </p> +<ul> + +<li> + Start two instances of sample Axis2 server on HTTP ports 9000,9001. And deploy the SimpleStockQuoteService in all of them. + </li> + +<li> + Start Synapse using the configuration numbered 854 (repository/conf/sample/synapse_sample_854.xml) + +<div class="command"> + Unix/Linux: sh synapse.sh -sample 854<br /> + Windows: synapse.bat -sample 854 + </div> + </li> + </ul> + + </div> + +<div class="section"> +<h3><a name="Executing_the_Client"></a>Executing the Client</h3> + +<p> +In this sample, the messages sent to Synapse will be route to a secondary channel(wiretap_uri) while they are being forwarded to the main channel(destination_uri). +</p> + +<p> + Invoke the client as follows. + </p> + +<div class="command">ant stockquote -Dtrpurl=http://localhost:8280/</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 ©2005–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/sample855.html URL: http://svn.apache.org/viewvc/synapse/site/3_0_2/userguide/samples/sample855.html?rev=1909775&view=auto ============================================================================== --- synapse/site/3_0_2/userguide/samples/sample855.html (added) +++ synapse/site/3_0_2/userguide/samples/sample855.html Fri May 12 16:09:34 2023 @@ -0,0 +1,208 @@ +<!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 – Apache Synapse - Sample 855</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_855:_Introduction_to_Synapse_Content_Based_Router_eip_function_template"></a>Sample 855: Introduction to Synapse Content Based Router eip function template</h2> + +<div class="xmlConf"><!-- Introduction to Synapse Content Based Router eip function template --> +<definitions xmlns="http://ws.apache.org/ns/synapse"> +<import xmlns="http://ws.apache.org/ns/synapse" name="EipLibrary" package="synapse.lang.eip" /> +<proxy name="StockQuoteProxy" transports="https http" startOnLoad="true" trace="disable"> + <target> + <inSequence> + <call-template target="synapse.lang.eip.content_based_router"> +<with-param name="routing_exp" value="{{//m0:getQuote/m0:request/m0:symbol}}" xmlns:m0="http://services.samples"/> +<with-param name="match_content" value="IBM:cnd1_seq,MSFT:cnd2_seq;cnd3_seq"/> + </call-template> +</inSequence> +<outSequence> +<send/> + </outSequence> + </target> + </proxy> +<sequence name="send_seq"> + <log level="custom"> + <property name="DEBUG" value="Condition Satisfied"/> + </log> + <send> + <endpoint name="simple"> + <address uri="http://localhost:9000/services/SimpleStockQuoteService"/> + </endpoint> + </send> + </sequence> + + <sequence name="cnd1_seq"> + <log level="custom"> + <property name="MSG_FLOW" value="Condition (I) Satisfied"/> + </log> + <sequence key="send_seq"/> + </sequence> + <sequence name="cnd2_seq"> + <log level="custom"> + <property name="MSG_FLOW" value="Condition (II) Satisfied"/> + </log> + <sequence key="send_seq"/> + </sequence> + <sequence name="cnd3_seq"> + <log level="custom"> + <property name="MSG_FLOW" value="Condition (III) Satisfied"/> + </log> + <sequence key="send_seq"/> + </sequence> +</definitions></div> + +<div class="section"> +<h3><a name="Objective"></a>Objective</h3> + +<p> +This sample is an introduction Synapse Content Based Router eip function template. + </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 855 (repository/conf/sample/synapse_sample_855.xml) + +<div class="command"> + Unix/Linux: sh synapse.sh -sample 855<br /> + Windows: synapse.bat -sample 855 + </div> + </li> + </ul> + + </div> + +<div class="section"> +<h3><a name="Executing_the_Client"></a>Executing the Client</h3> + +<p> +In this sample, it routes the message by matching the specified Xpath to the regular expression. Execute the StockQuote client in the dumb client mode, specifying 'IBM', 'MSFT' and 'DELL' as the stock symbols. +</p> + +<p>When the symbol IBM is requested, you will see cnd1_seq sequence is getting executed.</p> + +<div class="command">ant stockquote -Dtrpurl=http://localhost:8280/services/StockQuoteProxy -Dsymbol=IBM</div> + +<p>When the symbol MSFT is requested, you will see cnd2_seq sequence is getting executed.</p> + +<div class="command">ant stockquote -Dtrpurl=http://localhost:8280/services/StockQuoteProxy -Dsymbol=MSFT</div> + +<p>When the symbol DELL is requested, you will see cnd3_seq sequence is getting executed , which is the default sequence.</p> + +<div class="command">ant stockquote -Dtrpurl=http://localhost:8280/services/StockQuoteProxy -Dsymbol=DELL</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 ©2005–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/sample856.html URL: http://svn.apache.org/viewvc/synapse/site/3_0_2/userguide/samples/sample856.html?rev=1909775&view=auto ============================================================================== --- synapse/site/3_0_2/userguide/samples/sample856.html (added) +++ synapse/site/3_0_2/userguide/samples/sample856.html Fri May 12 16:09:34 2023 @@ -0,0 +1,213 @@ +<!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 – Apache Synapse - Sample 856</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_856:_Introduction_to_Synapse_Dynamic_Router_eip_function_template"></a>Sample 856: Introduction to Synapse Dynamic Router eip function template</h2> + +<div class="xmlConf"><!-- Introduction to Synapse Dynamic Router eip function template --> +<definitions xmlns="http://ws.apache.org/ns/synapse"> +<import xmlns="http://ws.apache.org/ns/synapse" name="EipLibrary" package="synapse.lang.eip" /> + <proxy name="StockQuoteProxy" transports="https http" startOnLoad="true" trace="disable"> + <target> + <inSequence> + <call-template target="synapse.lang.eip.dynamic_router"> +<with-param name="conditions" value="header=foo:bar.*{AND}url=/services/StockQuoteProxy.*;seq=cnd1_seq,header=custom_header1:bar.*{OR}header=custom_header1:foo.*;seq=cnd2_seq,header=custom_header2:foo.*;seq=cnd3_seq"/> + </call-template> + </inSequence> + <outSequence> + <send/> + </outSequence> + </target> + </proxy> +<sequence name="send_seq"> + <log level="custom"> + <property name="DEBUG" value="Condition Satisfied"/> + </log> + <send> + <endpoint name="simple"> + <address uri="http://localhost:9000/services/SimpleStockQuoteService"/> + </endpoint> + </send> + </sequence> + + <sequence name="cnd1_seq"> + <log level="custom"> + <property name="MSG_FLOW" value="Condition (I) Satisfied"/> + </log> + <sequence key="send_seq"/> + </sequence> + <sequence name="cnd2_seq"> + <log level="custom"> + <property name="MSG_FLOW" value="Condition (II) Satisfied"/> + </log> + <sequence key="send_seq"/> + </sequence> + <sequence name="cnd3_seq"> + <log level="custom"> + <property name="MSG_FLOW" value="Condition (III) Satisfied"/> + </log> + <sequence key="send_seq"/> + </sequence> +</definitions></div> + +<div class="section"> +<h3><a name="Objective"></a>Objective</h3> + +<p> +This sample is an introduction to Synapse Dynamic Router eip function template. + </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 856 (repository/conf/sample/synapse_sample_856.xml) + +<div class="command"> + Unix/Linux: sh synapse.sh -sample 856<br /> + Windows: synapse.bat -sample 856 + </div> + </li> + </ul> + + </div> + +<div class="section"> +<h3><a name="Executing_the_Client"></a>Executing the Client</h3> + +<p> +In this sample, it checks whether the route condition based on HTTP url,HTTP headers evaluates to true and mediates using the given sequence. We will be using 'curl' as the client in this scenario. +</p> + +<p>Invoke curl commands as follows to see dynamic routing in action.</p> + +<div class="command">curl -d @stockQuoteReq.xml -H "Content-Type: application/soap+xml;charset=UTF-8" -H "foo:bar" "http://localhost:8280/services/StockQuoteProxy</div> + +<p>You will see logs according to cnd1_seq in console.</p> + +<div class="command">curl -d @stockQuoteReq.xml -H "Content-Type: application/soap+xml;charset=UTF-8" -H "custom_header1:foo" "http://localhost:8280/services/StockQuoteProxy"</div> + +<p>or</p> + +<div class="command">curl -d @stockQuoteReq.xml -H "Content-Type: application/soap+xml;charset=UTF-8" -H "custom_header1:bar" "http://localhost:8280/services/StockQuoteProxy"</div> + +<p>You will see logs according to cnd2_seq in console.</p> + +<div class="command">curl -d @stockQuoteReq.xml -H "Content-Type: application/soap+xml;charset=UTF-8" -H "custom_header2:foo" "http://localhost:8280/services/StockQuoteProxy"</div> + +<p>You will see logs according to cnd3_seq in console.</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 ©2005–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/sample857.html URL: http://svn.apache.org/viewvc/synapse/site/3_0_2/userguide/samples/sample857.html?rev=1909775&view=auto ============================================================================== --- synapse/site/3_0_2/userguide/samples/sample857.html (added) +++ synapse/site/3_0_2/userguide/samples/sample857.html Fri May 12 16:09:34 2023 @@ -0,0 +1,167 @@ +<!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 – Apache Synapse - Sample 857</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_857:_Introduction_to_Synapse_Recipient_List_eip_function_template"></a>Sample 857: Introduction to Synapse Recipient List eip function template</h2> + +<div class="xmlConf"><!-- Introduction to Synapse Recipient List eip function template --> +<definitions xmlns="http://ws.apache.org/ns/synapse"> +<import xmlns="http://ws.apache.org/ns/synapse" name="EipLibrary" package="synapse.lang.eip" /> + <sequence name="main"> + <property name="OUT_ONLY" value="true"/> + <property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/> + <call-template target="synapse.lang.eip.recipient_list"> + <with-param name="recipient_list" value="http://localhost:9000/services/SimpleStockQuoteService,http://localhost:9001/services/SimpleStockQuoteService"/> + </call-template> + <drop/> +</sequence> +</definitions></div> + +<div class="section"> +<h3><a name="Objective"></a>Objective</h3> + +<p> +This sample is an introduction to Synapse Recipient List eip function template. + </p> + </div> + +<div class="section"> +<h3><a name="Pre-requisites"></a>Pre-requisites</h3> + +<p> + </p> +<ul> + +<li> + Start two instances of sample Axis2 server on HTTP ports 9000,9001. And deploy the SimpleStockQuoteService in all of them. + </li> + +<li> + Start Synapse using the configuration numbered 857 (repository/conf/sample/synapse_sample_857.xml) + +<div class="command"> + Unix/Linux: sh synapse.sh -sample 857<br /> + Windows: synapse.bat -sample 857 + </div> + </li> + </ul> + + </div> + +<div class="section"> +<h3><a name="Executing_the_Client"></a>Executing the Client</h3> + +<p> +In this sample, the messages sent to Synapse will be route to the endpoints defined under recipient_list parameter. +</p> + +<p> + Invoke the client as follows. + </p> + +<div class="command">ant stockquote -Dtrpurl=http://localhost:8280/</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 ©2005–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/sample9.html URL: http://svn.apache.org/viewvc/synapse/site/3_0_2/userguide/samples/sample9.html?rev=1909775&view=auto ============================================================================== --- synapse/site/3_0_2/userguide/samples/sample9.html (added) +++ synapse/site/3_0_2/userguide/samples/sample9.html Fri May 12 16:09:34 2023 @@ -0,0 +1,210 @@ +<!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 – Apache Synapse - Sample 9</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_9:_Introduction_to_Dynamic_Sequences_with_Registry"></a>Sample 9: Introduction to Dynamic Sequences with Registry</h2> + +<div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse"> + + <registry provider="org.apache.synapse.registry.url.SimpleURLRegistry"> + <parameter name="root">file:./repository/conf/sample/resources/</parameter> + <parameter name="cachableDuration">15000</parameter> + </registry> + + <sequence name="main"> + <sequence key="sequence/dynamic_seq_1.xml"/> + </sequence> + +</definitions></div> + +<div class="section"> +<h3><a name="Objective"></a>Objective</h3> + +<p> + Demonstrating the ability to load sequence definitions dynamically from the + remote registry. + </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 9 (repository/conf/sample/synapse_sample_9.xml) + +<div class="command"> + Unix/Linux: sh synapse.sh -sample 9<br /> + Windows: synapse.bat -sample 9 + </div> + </li> + </ul> + + </div> + +<div class="section"> +<h3><a name="Executing_the_Client"></a>Executing the Client</h3> + +<p> + This example demonstrates the dynamic behaviour of Synapse through the use of a + registry. Synapse supports dynamic definitions for sequences and endpoints, and + as seen before, for configuration resources (eg: schema files, XSLT files etc). + In this example we define a Synapse configuration which references a sequence + definition specified as a registry key. The registry key resolves to the actual + content of the sequence which would be loaded dynamically by Synapse at runtime, + and cached appropriately as per its definition in the registry. Once the cache + expires, Synapse would re-check the meta information for the definition and + re-load the sequence definition if necessary and re-cache it again. + </p> + +<p> + Execute the client as follows. + </p> + +<div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/</div> + +<p> + Go through the mediation debug logs to see how Synapse has dynamically loaded + the sequence configurations from the registry. + </p> + +<div class="consoleOutput">[HttpServerWorker-1] DEBUG SimpleURLRegistry - ==> Repository fetch of resource with key : sequence/dynamic_seq_1.xml +... +[HttpServerWorker-1] DEBUG SequenceMediator - Sequence mediator <dynamic_sequence> :: mediate() +... +[HttpServerWorker-1] INFO LogMediator - message = *** Test Message 1 ***</div> + +<p> + Now if you execute the client immediately (i.e. within 15 seconds of the last + execution) you will notice that the sequence is not reloaded. If you edit the + sequence definition in repository/conf/sample/resources/sequence/dynamic_seq_1.xml + (i.e. edit the log message to read as '*** Test Message 2 ***') and execute the + client again, you will notice that the new message is not yet visible (i.e. if + you execute this within 15 seconds of loading the resource for the first time). + However, after 15 seconds elapsed since the original caching of the sequence, + you will notice that the new sequence is loaded and executed by Synapse from the + following log messages. + </p> + +<div class="consoleOutput">[HttpServerWorker-1] DEBUG SimpleURLRegistry - ==> Repository fetch of resource with key : sequence/dynamic_seq_1.xml +... +[HttpServerWorker-1] DEBUG SequenceMediator - Sequence mediator <dynamic_sequence> :: mediate() +... +[HttpServerWorker-1] INFO LogMediator - message = *** Test Message 2 ***</div> + +<p> + The cache timeout could be tuned appropriately by configuring the URL registry + to suit the environment and the needs. + </p> + </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 ©2005–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/setup/db.html URL: http://svn.apache.org/viewvc/synapse/site/3_0_2/userguide/samples/setup/db.html?rev=1909775&view=auto ============================================================================== --- synapse/site/3_0_2/userguide/samples/setup/db.html (added) +++ synapse/site/3_0_2/userguide/samples/setup/db.html Fri May 12 16:09:34 2023 @@ -0,0 +1,331 @@ +<!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 – Apache Synapse - Database Setup Guide</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="Database_Setup_Guide"></a>Database Setup Guide</h2> + +<p> + This document explains how to setup a database and some data sources as required + by the samples. Most samples require an Apache Derby installation whereas a few + would require a MySQL setup. + </p> + </div> + +<div class="section"> +<h2><a name="Contents"></a>Contents</h2> + +<ul> + +<li><a href="#intro">Introduction</a></li> + +<li><a href="#derby">Setting Up Apache Derby</a></li> + +<li><a href="#mysql">Setting Up MySQL</a></li> + +<li><a href="#other">Using Other Database Engines</a></li> + +<li><a href="#ds">Setting Up Data Sources</a></li> + </ul> + </div> + <a name="intro"></a> +<div class="section" id="intro"> +<h2><a name="Introduction"></a>Introduction</h2> + +<p> + Apache Synapse has the ability to lookup and update relational databases through + JDBC. Any database engine that provides JDBC drivers can be integrated with + Synapse using the dblookup and dbreport mediators. Synapse ships with a collection + of samples which demonstrates various aspects of dblookup, dbreport mediators and + database integration. This article describes how to setup the databases, sample + tables and reusable data sources required to try these examples out. + </p> + +<p> + Most samples assume Apache Derby is used as the database engine. And therefore this + article also focuses mainly on setting up Apache Derby. Byt in reality + any database engine can be used to run these samples. The database schema and SQL + queries described here will work with any database engine. However in such cases + some minor changes should be made to the Synapse configuration files. + </p> + +<p> + Some samples involve invoking database stored procedures from Synapse. For these + samples MySQL database engine is assumed. Therefore this article provides some + basic information on setting up MySQL for the example scenarios. + </p> + </div> + <a name="derby"></a> +<div class="section" id="derby"> +<h2><a name="Setting_Up_Apache_Derby"></a>Setting Up Apache Derby</h2> + +<p> + To start with, download the latest binary distribution of <a class="externalLink" href="http://db.apache.org/derby/">Apache Derby</a>. + Extract the downloaded archive to a suitable location in the local disk and switch + to the 'bin' directory of the installation. Start the Derby network server by + executing the 'startNetworkServer' startup script. An output similar to the following + will be displayed as the database engine starts up. + </p> + +<div class="consoleOutput">Sun Jan 02 10:53:28 IST 2011 : Security manager installed using the Basic server security policy. +Sun Jan 02 10:53:30 IST 2011 : Apache Derby Network Server - 10.7.1.1 - (1040133) started and ready to accept connections on port 1527</div> + +<p> + Now launch the Derby client tool by executing the 'ij' script. This will give a command + prompt where you can execute various command and SQL queries. Execute the following + connect statement to create a fresh database named 'synapsedb' and obtain a connection + to it. + </p> + +<div class="command">CONNECT 'jdbc:derby://localhost:1527/synapsedb;user=synapse;password=synapse;create=true';</div> + +<p> + Now execute the following SQL query to create a new table. + </p> + +<div class="command">CREATE table company(name varchar(10), id varchar(10), price double);</div> + +<p> + Insert some sample data to the table by executing following statements. + </p> + +<div class="command">INSERT into company values ('IBM','c1',0.0); +INSERT into company values ('SUN','c2',0.0); +INSERT into company values ('MSFT','c3',0.0);</div> + +<p> + Now we have finished setting up the Derby server for the samples. As the final step + we should copy the Derby JDBC drivers to Synapse 'lib' directory. Locate the following + jar files in Derby installation and copy them into Synapse. + </p> + +<ul> + +<li>derby.jar</li> + +<li>derbyclient.jar</li> + +<li>derbynet.jar</li> + </ul> + </div> + <a name="mysql"></a> +<div class="section" id="mysql"> +<h2><a name="Setting_Up_MySQL"></a>Setting Up MySQL</h2> + +<p> + This section assumes that you already have a MySQL server instance up and running. + For details on installing MySQL, please refer the relevant + <a class="externalLink" href="http://dev.mysql.com/doc/refman/5.1/en/installing.html">MySQL documentation</a>. + </p> + +<p> + Create a new database named 'synapsedb' in MySQL. Then execute the SQL queries + given in the previous section to create a table named 'company' and insert some + sample data into it. Then execute the following two commands in MySQL client to + create two stored procedures. + </p> + +<div class="command">CREATE PROCEDURE getCompany(compName VARCHAR(10)) SELECT name, id, price FROM company WHERE name = compName; +CREATE PROCEDURE updateCompany(compPrice DOUBLE,compName VARCHAR(10)) UPDATE company SET price = compPrice WHERE name = compName;</div> + +<p> + Then you should download the <a class="externalLink" href="http://www.mysql.com/products/connector/">MySQL JDBC driver</a> + and deploy it into the 'lib' directory of Synapse. + </p> + </div> + <a name="other"></a> +<div class="section" id="other"> +<h2><a name="Using_Other_Database_Engines"></a>Using Other Database Engines</h2> + +<p> + You can run the given samples using any RDBMS engine you prefer. In that case please + make sure you do the following. + </p> + +<ul> + +<li>Deploy the JDBC drivers for your database engine into Synapse</li> + +<li> + Update the sample configuration files and change the driver class name and JDBC + connection string correctly + </li> + </ul> + </div> + +<div class="section"> +<h2><a name="Setting_Up_Data_Sources"></a>Setting Up Data Sources</h2> + +<p> + Synapse is capable of connecting to databases through predefined data sources. + This enables database connection pooling and connection reuse. Different instances + of the database mediators (dblookup/dbreport) can either use different data sources + or share the same data source. + </p> + +<p> + Data sources are configured in the synapse.properties file which can be found in the + 'lib' directory of the Synapse installation. Currently Synapse supports following + types of data sources. + </p> + +<ul> + +<li>BasicDataSource</li> + +<li>PerUserPoolDataSource</li> + </ul> + +<p> + Both these types of data sources are based on <a class="externalLink" href="http://commons.apache.org/dbcp">Apache DBCP</a>. + </p> + +<p> + Following section describes how to setup two data sources as required by some of the + database integration samples of Synapse. First, it is required to setup two + Derby databases. So launch 'ij' client tool for Derby and create two databases + named 'lookupdb' and 'reportdb'. Specify the username and password to be 'synapse' + for both databases. Create the 'company' table in each database and add some sample + data as described under <a href="#derby">Setting Up Apache Derby</a> section. + </p> + +<p> + Now you can define two data sources for these databases by adding the following + entries to the synapse.properties file. + </p> + +<div class="consoleOutput">synapse.datasources=lookupds,reportds +synapse.datasources.icFactory=com.sun.jndi.rmi.registry.RegistryContextFactory +synapse.datasources.providerUrl=rmi://localhost:2199 +synapse.datasources.providerPort=2199 + +synapse.datasources.lookupds.type=BasicDataSource +synapse.datasources.lookupds.driverClassName=org.apache.derby.jdbc.ClientDriver +synapse.datasources.lookupds.url=jdbc:derby://localhost:1527/lookupdb;create=false +synapse.datasources.lookupds.username=synapse +synapse.datasources.lookupds.password=synapse +synapse.datasources.lookupds.dsName=lookupdb +synapse.datasources.lookupds.maxActive=100 +synapse.datasources.lookupds.maxIdle=20 +synapse.datasources.lookupds.maxWait=10000 + +synapse.datasources.reportds.type=PerUserPoolDataSource +synapse.datasources.reportds.cpdsadapter.factory=org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS +synapse.datasources.reportds.cpdsadapter.className=org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS +synapse.datasources.reportds.cpdsadapter.name=cpds +synapse.datasources.reportds.dsName=reportdb +synapse.datasources.reportds.driverClassName=org.apache.derby.jdbc.ClientDriver +synapse.datasources.reportds.url=jdbc:derby://localhost:1527/reportdb;create=false +synapse.datasources.reportds.username=synapse +synapse.datasources.reportds.password=synapse +synapse.datasources.reportds.maxActive=100 +synapse.datasources.reportds.maxIdle=20 +synapse.datasources.reportds.maxWait=10000</div> + +<p> + Here we are defining two data sources named 'lookupds' and 'reportds'. The first + data source is defined as a BasicDataSource and the other one is defined as a + PerUserPoolDataSource. Note the various parameters we have specified for each + data source thereby further customizing the behavior of each data source. + </p> + </div> + + + </div> + </div> + </div> + <hr/> + <footer> + <div class="container-fluid"> + <div class="row-fluid"> + <p>Copyright ©2005–2023 +<a href="http://www.apache.org/">Apache Software Foundation</a>. +All rights reserved.</p> + </div> + </div> + </footer> + </body> +</html>