Added: synapse/site/3_0_2/userguide/samples/sample7.html URL: http://svn.apache.org/viewvc/synapse/site/3_0_2/userguide/samples/sample7.html?rev=1909775&view=auto ============================================================================== --- synapse/site/3_0_2/userguide/samples/sample7.html (added) +++ synapse/site/3_0_2/userguide/samples/sample7.html Fri May 12 16:09:34 2023 @@ -0,0 +1,212 @@ +<!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 7</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_7:_Introduction_to_Local_Registry_Entries_and_Using_Schema_Validation"></a>Sample 7: Introduction to Local Registry Entries and Using Schema Validation</h2> + +<div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse"> + + <sequence name="main"> + <in> + <validate> + <schema key="validate_schema"/> + <on-fail> + <!-- if the request does not validate againt schema throw a fault --> + <makefault response="true"> + <code xmlns:tns="http://www.w3.org/2003/05/soap-envelope" value="tns:Receiver"/> + <reason value="Invalid custom quote request"/> + </makefault> + </on-fail> + </validate> + </in> + <send/> + </sequence> + + <localEntry key="validate_schema"> + <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" + xmlns="http://services.samples" elementFormDefault="qualified" + attributeFormDefault="unqualified" targetNamespace="http://services.samples"> + <xs:element name="getQuote"> + <xs:complexType> + <xs:sequence> + <xs:element name="request"> + <xs:complexType> + <xs:sequence> + <xs:element name="stocksymbol" type="xs:string"/> + </xs:sequence> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + </xs:schema> + </localEntry> + +</definitions></div> + +<div class="section"> +<h3><a name="Objective"></a>Objective</h3> + +<p> + Demonstrating the usage of the validate mediator for XML schema validation + and using local registry (local entries) for storing configuration metadata. + </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 7 (repository/conf/sample/synapse_sample_7.xml) + +<div class="command"> + Unix/Linux: sh synapse.sh -sample 7<br /> + Windows: synapse.bat -sample 7 + </div> + </li> + </ul> + + </div> + +<div class="section"> +<h3><a name="Executing_the_Client"></a>Executing the Client</h3> + +<p> + This example shows how a static XML fragment could be stored in the the + Synapse local registry. Resources defined in the local registry are static + (i.e. never changes over the lifetime of the configuration) and may be + specified as a source URL, in-line text or in-line xml. In this example the + schema is made available under the key 'validate_schema'. + </p> + +<p> + The validate mediator by default operates on the first child element of the + SOAP body. You may specify an XPath expression using the 'source' attribute + to override this behaviour. The validate mediator in this sample uses the 'validate_schema' + resource to validate the incoming message, and if the message validation fails + it invokes the 'on-fail' sequence of mediators. + </p> + +<p> + If you send a stockquote request using the 'ant stockquote ...' command as follows + you will get a fault back with the message 'Invalid custom quote request' as + the schema validation fails. This is because the schema used in the example + expects a slightly different message than what is created by the stock quote + client. (i.e. expects a 'stocksymbol' element instead of 'symbol' to specify + the stock symbol) + </p> + +<div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -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/sample700.html URL: http://svn.apache.org/viewvc/synapse/site/3_0_2/userguide/samples/sample700.html?rev=1909775&view=auto ============================================================================== --- synapse/site/3_0_2/userguide/samples/sample700.html (added) +++ synapse/site/3_0_2/userguide/samples/sample700.html Fri May 12 16:09:34 2023 @@ -0,0 +1,201 @@ +<!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 700</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_700:_Introduction_to_Synapse_Message_Stores"></a>Sample 700: Introduction to Synapse Message Stores</h2> + +<div class="xmlConf"><!-- Introduction to the Message Store --> +<definitions xmlns="http://ws.apache.org/ns/synapse"> + <sequence name="fault"> + <log level="full"> + <property name="MESSAGE" value="Executing default 'fault' sequence"/> + <property name="ERROR_CODE" expression="get-property('ERROR_CODE')"/> + <property name="ERROR_MESSAGE" + expression="get-property('ERROR_MESSAGE')"/> + </log> + <drop/> + </sequence> + <sequence name="onStoreSequence"> + <log> + <property name="On-Store" value="Storing message"/> + </log> + </sequence> + <sequence name="main"> + <in> + <log level="full"/> + <property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/> + <store messageStore="MyStore" sequence="onStoreSequence"/> + </in> + <description>The main sequence for the message mediation</description> + </sequence> + <messageStore name="MyStore"/> +</definitions></div> + +<div class="section"> +<h3><a name="Objective"></a>Objective</h3> + +<p> + Introduction to Message Stores + </p> + </div> + +<div class="section"> +<h3><a name="Pre-requisites"></a>Pre-requisites</h3> + +<p> + </p> +<ul> + +<li> + Start Synapse using the configuration numbered 700 (repository/conf/sample/synapse_sample_700.xml) + +<div class="command"> + Unix/Linux: sh synapse.sh -sample 700<br /> + Windows: synapse.bat -sample 700 + </div> + </li> + </ul> + + </div> + +<div class="section"> +<h3><a name="Executing_the_Client"></a>Executing the Client</h3> + +<p> + First execute the sample client as follows. + </p> + +<div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/ -Dmode=placeorder + </div> + +<p> + When you execute the client the message will be dispatched to the main sequence. + In the Main sequence store mediator will store the placeOrder request message in + the 'MyStore' Message Store. + </p> + +<p> + Now you can use the JMX view of the Synapse message store to see the messages + stored in the dead letter channel and manually perform retries on them. + </p> + +<p> + Before storing the message, store mediator will invoke the sequence named + 'onStoreSequence'. You should see something similar to the following in the + log. + </p> + +<div class="command"> + INFO - LogMediator To: http://localhost:9000/services/SimpleStockQuoteService, + WSAction: urn:placeOrder, SOAPAction: urn:placeOrder, ReplyTo: + http://www.w3.org/2005/08/addressing/none, MessageID: + urn:uuid:54f0e7c6-7b43-437c-837e-a825d819688c, Direction: request, On-Store = + Storing message + </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/sample701.html URL: http://svn.apache.org/viewvc/synapse/site/3_0_2/userguide/samples/sample701.html?rev=1909775&view=auto ============================================================================== --- synapse/site/3_0_2/userguide/samples/sample701.html (added) +++ synapse/site/3_0_2/userguide/samples/sample701.html Fri May 12 16:09:34 2023 @@ -0,0 +1,202 @@ +<!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 701</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_701:_Introduction_to_Message_Sampling_Processor"></a>Sample 701: Introduction to Message Sampling Processor</h2> + +<div class="xmlConf"><!-- Introduction to Message Sampling Processor --> +<definitions xmlns="http://ws.apache.org/ns/synapse"> + <sequence name="send_seq"> + <send> + <endpoint> + <address uri="http://localhost:9000/services/SimpleStockQuoteService"> + <suspendOnFailure> + <errorCodes>-1</errorCodes> + <progressionFactor>1.0</progressionFactor> + </suspendOnFailure> + </address> + </endpoint> + </send> + </sequence> + <sequence name="main"> + <in> + <log level="full"/> + <property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/> + <property name="OUT_ONLY" value="true"/> + <store messageStore="MyStore"/> + </in> + <description>The main sequence for the message mediation</description> + </sequence> + <messageStore name="MyStore"/> + <messageProcessor + class="org.apache.synapse.message.processors.sampler.SamplingProcessor" + name="SamplingProcessor" messageStore="MyStore"> + <parameter name="interval">20000</parameter> + <parameter name="sequence">send_seq</parameter> + </messageProcessor> +</definitions></div> + +<div class="section"> +<h3><a name="Objective"></a>Objective</h3> + +<p> + Introduction to Message Sampling Processor + </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 701 (repository/conf/sample/synapse_sample_701.xml) + +<div class="command"> + Unix/Linux: sh synapse.sh -sample 701<br /> + Windows: synapse.bat -sample 701 + </div> + </li> + </ul> + + </div> + +<div class="section"> +<h3><a name="Executing_the_Client"></a>Executing the Client</h3> + +<p> + Execute the Client few times with command : + </p> + +<div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/ -Dmode=placeorder + </div> + + +<p> + When you execute the client the message will be dispatched to the main sequence. + In the Main sequence store mediator will store the placeOrder request message in + the 'MyStore' message store. + </p> + +<p> + Message Processor will consume the messages and forward to the 'send_seq' sequence + in the configured rate. + </p> + +<p> + You will observe that service invocation rate is not changing when increasing the + rate at which we execute the client. + </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/sample702.html URL: http://svn.apache.org/viewvc/synapse/site/3_0_2/userguide/samples/sample702.html?rev=1909775&view=auto ============================================================================== --- synapse/site/3_0_2/userguide/samples/sample702.html (added) +++ synapse/site/3_0_2/userguide/samples/sample702.html Fri May 12 16:09:34 2023 @@ -0,0 +1,207 @@ +<!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 702</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_702:_Introduction_to_Message_Forwarding_Processor"></a>Sample 702: Introduction to Message Forwarding Processor</h2> + +<div class="xmlConf"><!-- Introduction to Scheduled Message Forwarding Processor --> +<definitions xmlns="http://ws.apache.org/ns/synapse"> + + <endpoint name="StockQuoteServiceEp"> + <address uri="http://localhost:9000/services/SimpleStockQuoteService"> + <suspendOnFailure> + <errorCodes>-1</errorCodes> + <progressionFactor>1.0</progressionFactor> + </suspendOnFailure> + </address> + </endpoint> + <sequence name="fault"> + <log level="full"> + <property name="MESSAGE" value="Executing default 'fault' sequence"/> + <property name="ERROR_CODE" expression="get-property('ERROR_CODE')"/> + <property name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')"/> + </log> + <drop/> + </sequence> + <sequence name="main"> + <in> + <log level="full"/> + <property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/> + <property name="OUT_ONLY" value="true"/> + <property name="target.endpoint" value="StockQuoteServiceEp"/> + <store messageStore="MyStore"/> + </in> + <description>The main sequence for the message mediation</description> + </sequence> + <messageStore name="MyStore"/> + <messageProcessor + class="org.apache.synapse.message.processors.forward.ScheduledMessageForwardingProcessor" + name="ScheduledProcessor" messageStore="MyStore"> + <parameter name="interval">10000</parameter> + </messageProcessor> +</definitions> + </div> + +<div class="section"> +<h3><a name="Objective"></a>Objective</h3> + +<p> + Introduction to Message Forwarding Processor + </p> + </div> + +<div class="section"> +<h3><a name="Pre-requisites"></a>Pre-requisites</h3> + +<p> + </p> +<ul> + +<li> + Start Synapse using the configuration numbered 702 (repository/conf/sample/synapse_sample_702.xml) + +<div class="command"> + Unix/Linux: sh synapse.sh -sample 702<br /> + Windows: synapse.bat -sample 702 + </div> + </li> + </ul> + + </div> + +<div class="section"> +<h3><a name="Executing_the_Client"></a>Executing the Client</h3> + +<p> + Execute the sample client a few times with the following command. Note that + we still haven't started the sample Axis2 server. + </p> + +<div class="command"> + ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/ -Dmode=placeorder + </div> + + +<p> + Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2. + </p> + +<p> + When you start the service you will see messages getting delivered to the service, + even though the service was actually down when we invoked the sample client. + </p> + +<p> + Here in the 'main' sequence store mediator will store the placeOrder request + message in the 'MyStore' message store. Message processor will send the message + to the endpoint which is configured as a message context property. Message + processor will remove the message from the store only if the message is delivered + successfully. + </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/sample703.html URL: http://svn.apache.org/viewvc/synapse/site/3_0_2/userguide/samples/sample703.html?rev=1909775&view=auto ============================================================================== --- synapse/site/3_0_2/userguide/samples/sample703.html (added) +++ synapse/site/3_0_2/userguide/samples/sample703.html Fri May 12 16:09:34 2023 @@ -0,0 +1,233 @@ +<!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 703</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_703:_Introduction_to_Message_Resequencing_Processor"></a>Sample 703: Introduction to Message Resequencing Processor</h2> + +<div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse"> + + <sequence name="next_seq"> + <send> + <endpoint> + <address uri="http://localhost:9000/services/SimpleStockQuoteService"> + <suspendOnFailure> + <errorCodes>-1</errorCodes> + <progressionFactor>1.0</progressionFactor> + </suspendOnFailure> + </address> + </endpoint> + </send> + </sequence> + + <sequence name="main"> + <in> + <log level="full"/> + <property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/> + <property name="OUT_ONLY" value="true"/> + <store messageStore="MyStore"/> + </in> + <out> + <send /> + </out> + <description>The main sequence for the message mediation</description> + </sequence> + + <messageStore name="MyStore"/> + + <messageProcessor + class="org.apache.synapse.message.processors.resequence.ResequencingProcessor" + name="ResequencingProcessor" messageStore="MyStore"> + + <parameter name="interval">10000</parameter> + <parameter name="seqNumXpath" xmlns:m0="http://services.samples" expression="substring-after(//m0:placeOrder/m0:order/m0:symbol,'-')"/> + <parameter name="nextEsbSequence">next_seq</parameter> + + </messageProcessor> + +</definitions></div> + +<div class="section"> +<h3><a name="Objective"></a>Objective</h3> + +<p> + Introduction to Message Resequencing Processor + </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 703 (repository/conf/sample/synapse_sample_703.xml) + +<div class="command"> + Unix/Linux: sh synapse.sh -sample 703<br /> + Windows: synapse.bat -sample 703 + </div> + </li> + </ul> + + </div> + +<div class="section"> +<h3><a name="Executing_the_Client"></a>Executing the Client</h3> + +<p> + Execute the Client with commands : + </p> + +<div class="command">ant stockquote -Dtrpurl=http://localhost:8280/ -Dmode=placeorder -Dsymbol=WSO2-2<br /> + ant stockquote -Dtrpurl=http://localhost:8280/ -Dmode=placeorder -Dsymbol=WSO2-3<br /> + ant stockquote -Dtrpurl=http://localhost:8280/ -Dmode=placeorder -Dsymbol=WSO2-1 + </div> + +<p> + You have to use different sequence numbers for WSO2-#. According to configuration + sequence number should be seperated with a hyphen mark. + </p> + +<p> + When you execute the client the message will be dispatched to the main sequence. + In the Main sequence store mediator will store the placeOrder request message in + the 'MyStore' message store. + </p> + +<p> + Message Processor will consume the messages and forward to the 'next_seq' sequence + according to sequence number order. + </p> + +<p> + You will see that the Axis2 server has recieved the messages in sequence number order + </p> + +<p> + Following logic is used to decide the initial sequence number. + </p> +<ol style="list-style-type: decimal"> + +<li>When starting Synapse Resequencing Processor checks the attached message store for any messages. + If any messages found, select the minimum sequence number as the initial sequence number. Else continue without selecting initial sequence number.</li> + +<li>If initial sequence number is selected at the start up, continue sending messages to the given sequence. + Otherwise waits for required number of messages to come with in a certain timeout.</li> + +<li>If the required number of messages are received, select initial sequence number from those and do further resequencing. + If required number of messages are not received with in timeout, select the initial sequence number from available messages in the store.</li> + </ol> + + </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/sample704.html URL: http://svn.apache.org/viewvc/synapse/site/3_0_2/userguide/samples/sample704.html?rev=1909775&view=auto ============================================================================== --- synapse/site/3_0_2/userguide/samples/sample704.html (added) +++ synapse/site/3_0_2/userguide/samples/sample704.html Fri May 12 16:09:34 2023 @@ -0,0 +1,212 @@ +<!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 704</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_704:_Invoke_Secured_Services_with_Scheduled_Message_Forwarding_Processor"></a>Sample 704: Invoke Secured Services with Scheduled Message Forwarding Processor</h2> + +<div class="xmlConf"><!-- Invoke Secured Services with Scheduled Message Forwarding Processor --> + <definitions xmlns="http://ws.apache.org/ns/synapse"> + <localEntry key="sec_policy" src="file:repository/conf/sample/resources/policy/policy_3.xml"/> + <endpoint name="SecuredStockQuoteServiceEp"> + <address uri="http://localhost:9000/services/SecureStockQuoteService"> + <suspendOnFailure> + <errorCodes>-1</errorCodes> + <progressionFactor>1.0</progressionFactor> + </suspendOnFailure> + <enableSec policy="sec_policy"/> + </address> + </endpoint> + <sequence name="fault"> + <log level="full"> + <property name="MESSAGE" value="Executing default 'fault' sequence"/> + <property name="ERROR_CODE" expression="get-property('ERROR_CODE')"/> + <property name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')"/> + </log> + <drop/> + </sequence> + <sequence name="main"> + <in> + <log level="full"/> + <property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/> + <property name="OUT_ONLY" value="true"/> + <property name="target.endpoint" value="SecuredStockQuoteServiceEp"/> + <store messageStore="MyStore"/> + </in> + <description>The main sequence for the message mediation</description> + </sequence> + <messageStore name="MyStore"/> + <messageProcessor class="org.apache.synapse.message.processors.forward.ScheduledMessageForwardingProcessor" name="ScheduledProcessor" messageStore="MyStore"> + <parameter name="interval">10000</parameter> + </messageProcessor> + </definitions> + </div> + +<div class="section"> +<h3><a name="Objective"></a>Objective</h3> + +<p> + Invoke Secured Services with Scheduled Message Forwarding Processor + </p> + </div> + +<div class="section"> +<h3><a name="Pre-requisites"></a>Pre-requisites</h3> + +<p> + </p> +<ul> + +<li> + Download and install the Java Cryptography Extension (JCE) unlimited + strength policy files for your JDK + </li> + +<li> + Start Synapse using the configuration numbered 704 (repository/conf/sample/synapse_sample_704.xml) + +<div class="command"> + Unix/Linux: sh synapse.sh -sample 704<br /> + Windows: synapse.bat -sample 704 + </div> + </li> + </ul> + + </div> + +<div class="section"> +<h3><a name="Executing_the_Client"></a>Executing the Client</h3> + +<p> + Execute the sample client a few times with the following command. Note that + we still haven't started the sample Axis2 server. + </p> + +<div class="command"> + ant stockquote -Daddurl=http://localhost:8280/ -Dmode=placeorder + </div> + + +<p> + Deploy the SecureStockQuoteService in the sample Axis2 server and start Axis2. + </p> + +<p> + When you start the service you will see messages getting delivered to the service, + even though the service was actually down when we invoked the sample client. + </p> + +<p> + Here in the 'main' sequence, store mediator will store the placeOrder request + message in the 'MyStore' message store. + Message processor will send the message to the secured backend service using the defined endpoint. + Endpoint is configured to use WS-Security. + Message processor will remove the message from the store only if the message is delivered + successfully. + </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/sample705.html URL: http://svn.apache.org/viewvc/synapse/site/3_0_2/userguide/samples/sample705.html?rev=1909775&view=auto ============================================================================== --- synapse/site/3_0_2/userguide/samples/sample705.html (added) +++ synapse/site/3_0_2/userguide/samples/sample705.html Fri May 12 16:09:34 2023 @@ -0,0 +1,236 @@ +<!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 705</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_705:_Introduction_to_Message_Forwarding_Processor_With_Advance_Parameters"></a>Sample 705: Introduction to Message Forwarding Processor With Advance Parameters</h2> + +<div class="xmlConf"><!-- Introduction to Message Forwarding Processor With max deliver attempt and drop +<definitions xmlns="http://ws.apache.org/ns/synapse"> + <endpoint name="StockQuoteServiceEp"> + <address uri="http://localhost:9000/services/SimpleStockQuoteService"> + <suspendOnFailure> + <errorCodes>-1</errorCodes> + <progressionFactor>1.0</progressionFactor> + </suspendOnFailure> + </address> + </endpoint> + <sequence name="fault"> + <log level="full"> + <property name="MESSAGE" value="Executing default 'fault' sequence" /> + <property name="ERROR_CODE" expression="get-property('ERROR_CODE')" /> + <property name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')" /> + </log> + <drop /> + </sequence> + <sequence name="main"> + <in> + <log level="full" /> + <property name="FORCE_SC_ACCEPTED" value="true" scope="axis2" /> + <property name="OUT_ONLY" value="true" /> + <property name="target.endpoint" value="StockQuoteServiceEp" /> + <store messageStore="MyStore" /> + </in> + <description>The main sequence for the message mediation</description> + </sequence> + <messageStore name="MyStore" /> + <messageProcessor class="org.apache.synapse.message.processors.forward.ScheduledMessageForwardingProcessor" name="ScheduledProcessor" messageStore="MyStore"> + <parameter name="interval">10000</parameter> + <parameter name="max.deliver.attempts">3</parameter> + <parameter name="max.deliver.drop">true</parameter> + <parameter name="retry.http.status.codes">500, 504</parameter> + <parameter name="retry.interval">1000</parameter> + <parameter name="consume.all">false</parameter> + </messageProcessor> +</definitions> + </div> + +<div class="section"> +<h3><a name="Objective"></a>Objective</h3> + +<p> + Introduction to Synapse Scheduled Message Forwarding Processor with following advance parameters + </p> +<ul> + +<li>max.deliver.attempts</li> + +<li>max.deliver.drop</li> + +<li>retry.http.status.codes</li> + +<li>retry.interval</li> + </ul> + + </div> + +<div class="section"> +<h3><a name="Pre-requisites"></a>Pre-requisites</h3> + +<p> + </p> +<ul> + +<li> + Start Synapse using the configuration numbered 705 (repository/conf/sample/synapse_sample_705.xml) + +<div class="command"> + Unix/Linux: sh synapse.sh -sample 705<br /> + Windows: synapse.bat -sample 705 + </div> + </li> + </ul> + + </div> + +<div class="section"> +<h3><a name="Executing_the_Client"></a>Executing the Client</h3> + +<p> + Execute the sample client a few times with the following command. + </p> + +<div class="command"> + ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/ -Dmode=placeorder + </div> + + +<p> + When you start to send request to synapse from client, you will see message forwarding processor without + getting deactivate it keep on processing. This is due to the message will be dropped from the message store after + the maximum number of delivery attempts are made, and the message processor will remain activated. + + "max.deliver.drop" parameter would have no effect when no value is specified for the Maximum Delivery Attempts parameter. + If this parameter is disabled, the undeliverable message will not be dropped and the message processor will be deactivated. + </p> + +<p> + Message Forwarding Processor by default do not retry for application level failures. It only retries by default when + there is a network level failure. But if the user wants retry based on the application level failures, user can use + "retry.http.status.codes" configuration to do so. Please note that in this context application level failures refers to + HTTP error responses. For instance, in the above example Message Forwarding Processor retries not only for transport + level failures but also for application level failures such as Internal Server Error (500) and Gateway timeout (504). + </p> + +<p> + Message Forwarding Processor sends messages to the back-end with the interval configured using "interval" parameter. + However, when there is a failure, Message Forwarding Processor goes to retry mode. When retrying, + Message Forwarding Processor sends the message to the back-end with the interval configured using "retry.interval" + parameter. Similar to "interval" "retry.interval" value must be set in milli seconds. In the case of setting + a non-integer value, makes Message Forwarding Processor set the default value to "retry.interval", which is 1000ms. + </p> + +<p> + Every time the Message Forwarding Processor is triggered it consumes all the messages in the Message Store at once. For instance, + suppose, the Message Forwarding Processor is configured to run every ten seconds and the Message Store is filled + with five messages within the ten second gap. In such a situation, Message Forwarding Processor consumes all five messages + and try to send it to back-end as fast as possible. However, there could be situations where you need to send messages + to the back-end in a controlled rate. This can be achieved by setting the "consume.all" property value to false. When set to false, + the Message Forwarding Processor will only consume one message at each trigger. + </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>