Added: synapse/site/3_0_1/userguide/samples/sample500.html URL: http://svn.apache.org/viewvc/synapse/site/3_0_1/userguide/samples/sample500.html?rev=1817077&view=auto ============================================================================== --- synapse/site/3_0_1/userguide/samples/sample500.html (added) +++ synapse/site/3_0_1/userguide/samples/sample500.html Mon Dec 4 09:53:57 2017 @@ -0,0 +1,232 @@ +<!DOCTYPE html> +<!-- + | Generated by Apache Maven Doxia Site Renderer 1.7.4 at 2017-12-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="20171204" /> + <meta http-equiv="Content-Language" content="en" /> + <title>Apache Synapse – Apache Synapse - Sample 500</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: 2017-12-04<span class="divider">|</span> +</li> + <li id="projectVersion">Version: 3.0.1</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_500:_Introduction_to_Eventing"></a>Sample 500: Introduction to Eventing</h2> + +<div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse"> + + <eventSource name="SampleEventSource"> + <subscriptionManager + class="org.apache.synapse.eventing.managers.DefaultInMemorySubscriptionManager"> + <!--property name="registryURL" value="http://localhost:8180/wso2registry"/> + <property name="username" value="admin"/> + <property name="password" value="admin"/--> + <property name="topicHeaderName" value="Topic"/> + <property name="topicHeaderNS" value="http://apache.org/aip"/> + </subscriptionManager> + </eventSource> + + <sequence name="PublicEventSource"> + <log level="full"/> + <eventPublisher eventSourceName="SampleEventSource"/> + </sequence> + + <proxy name="EventingProxy"> + <target inSequence="PublicEventSource"/> + </proxy> + +</definitions></div> + +<div class="section"> +<h3><a name="Objective"></a>Objective</h3> + +<p> + Demonstrate the use of the Eventing functionality built into Synapse + </p> + </div> + +<div class="section"> +<h3><a name="Pre-requisites"></a>Pre-requisites</h3> + +<p> + </p> +<ul> + +<li> + Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2 + </li> + +<li> + Start Synapse using the configuration numbered 500 (repository/conf/sample/synapse_sample_500.xml) + +<div class="command"> + Unix/Linux: sh synapse.sh -sample 500<br /> + Windows: synapse.bat -sample 500 + </div> + </li> + </ul> + + </div> + +<div class="section"> +<h3><a name="Executing_the_Client"></a>Executing the Client</h3> + +<p> + In this sample an event source is creted based on the provided configuration. Event + subscriber subscribes for the events, Event sender publishes events and the + SimpleStockQuoteService acts as the Event Sink. + </p> + +<p> + First, invoke the sample client (Subscriber) as follows. + </p> + +<div class="command">ant eventsubscriber</div> + +<p> + This will create a new subscription with the SimpleStockQuoteService deployed on + the sample Axis2 server acting as the sink. Whenever a new event is published, + SimpleStockQuoteService will receive a message with that event. You should see a + message like this on the client console confirming the subscription. + </p> + +<div class="consoleOutput">[java] Subscription identifier: urn:uuid:6989F66706E73C69F5259116575749162017010321</div> + +<p> + You will need this identifier to modify the subscription in the next steps. Now, + invoke the client (Sender) as follows. + </p> + +<div class="command">ant eventsender</div> + +<p> + This will send a placeOrder request to the EventingProxy. You should see a + message in the Synapse logs. Note the presence of the following SOAP header + in the request. + </p> + +<div class="consoleOutput"><aip:Topic xmlns:aip="http://apache.org/aip">synapse/event/test</aip:Topic></div> + +<p> + Since there is a single subscription with SimpleStockQuoteService as the sink, + Synapse will send the message to the sample Axis2 server and you should see the + following message in its logs: + </p> + +<div class="consoleOutput">Accepted order for : 1000 stocks of GOOG at $ 10.1</div> + +<p> + You can also send various other WS-Eventing messages from the sample client to + modify the subscription details. To get the current status of the subscription, + invoke the client as follows. + </p> + +<div class="command">ant eventsubscriber -Dmode=getstatus -Didentifier=<i><identifier></i></div> + +<p> + To renew the subscription, invoke the client as follows. + </p> + +<div class="command">ant eventsubscriber -Dmode=renew -Didentifier=<i><identifier></i> -Dexpires=2012-12-31T21:07:00.000-08:00</div> + +<p> + Finally, in order to unsubscribe, use the following command. + </p> + +<div class="command">ant eventsubscriber -Dmode=unsubscribe -Didentifier=<i><identifier></i></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–2017 +<a href="http://www.apache.org/">Apache Software Foundation</a>. +All rights reserved.</p> + </div> + </div> + </footer> + </body> +</html>
Added: synapse/site/3_0_1/userguide/samples/sample501.html URL: http://svn.apache.org/viewvc/synapse/site/3_0_1/userguide/samples/sample501.html?rev=1817077&view=auto ============================================================================== --- synapse/site/3_0_1/userguide/samples/sample501.html (added) +++ synapse/site/3_0_1/userguide/samples/sample501.html Mon Dec 4 09:53:57 2017 @@ -0,0 +1,196 @@ +<!DOCTYPE html> +<!-- + | Generated by Apache Maven Doxia Site Renderer 1.7.4 at 2017-12-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="20171204" /> + <meta http-equiv="Content-Language" content="en" /> + <title>Apache Synapse – Apache Synapse - Sample 501</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: 2017-12-04<span class="divider">|</span> +</li> + <li id="projectVersion">Version: 3.0.1</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_501:_Event_Source_with_Static_Subscriptions"></a>Sample 501: Event Source with Static Subscriptions</h2> + +<div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse"> + + <eventSource name="SampleEventSource"> + <subscriptionManager + class="org.apache.synapse.eventing.managers.DefaultInMemorySubscriptionManager"> + <!--property name="registryURL" value="http://localhost:8180/wso2registry"/> + <property name="username" value="admin"/> + <property name="password" value="admin"/--> + <property name="topicHeaderName" value="Topic"/> + <property name="topicHeaderNS" value="http://apache.org/aip"/> + </subscriptionManager> + <subscription id="mysub1"> + <filter source="synapse/event/test" + dialect="http://synapse.apache.org/eventing/dialect/topicFilter"/> + <endpoint> + <address uri="http://localhost:9000/services/SimpleStockQuoteService"/> + </endpoint> + </subscription> + <subscription id="mysub2"> + <filter source="synapse/event/test" + dialect="http://synapse.apache.org/eventing/dialect/topicFilter"/> + <endpoint> + <address uri="http://localhost:9000/services/SimpleStockQuoteService"/> + </endpoint> + <expires>2020-06-27T21:07:00.000-08:00</expires> + </subscription> + </eventSource> + + <sequence name="PublicEventSource"> + <log level="full"/> + <eventPublisher eventSourceName="SampleEventSource"/> + </sequence> + + <proxy name="EventingProxy"> + <target inSequence="PublicEventSource"/> + </proxy> + +</definitions></div> + +<div class="section"> +<h3><a name="Objective"></a>Objective</h3> + +<p> + Showcase how to use a predefined set of static subscriptions with Synapse + </p> + </div> + +<div class="section"> +<h3><a name="Pre-requisites"></a>Pre-requisites</h3> + +<p> + </p> +<ul> + +<li> + Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2 + </li> + +<li> + Start Synapse using the configuration numbered 501 (repository/conf/sample/synapse_sample_501.xml) + +<div class="command"> + Unix/Linux: sh synapse.sh -sample 501<br /> + Windows: synapse.bat -sample 501 + </div> + </li> + </ul> + + </div> + +<div class="section"> +<h3><a name="Executing_the_Client"></a>Executing the Client</h3> + +<p> + In this sample configuration, two static subscriptions are created by providing the + SimpleStockQuoteService as the event sink. To try this out, invoke the sample + client as follows. + </p> + +<div class="command">ant eventsender</div> + +<p> + Events will be mediated and sent to the sample Axis2 server as operated by the + two static subscriptions. + </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–2017 +<a href="http://www.apache.org/">Apache Software Foundation</a>. +All rights reserved.</p> + </div> + </div> + </footer> + </body> +</html> Added: synapse/site/3_0_1/userguide/samples/sample502.html URL: http://svn.apache.org/viewvc/synapse/site/3_0_1/userguide/samples/sample502.html?rev=1817077&view=auto ============================================================================== --- synapse/site/3_0_1/userguide/samples/sample502.html (added) +++ synapse/site/3_0_1/userguide/samples/sample502.html Mon Dec 4 09:53:57 2017 @@ -0,0 +1,193 @@ +<!DOCTYPE html> +<!-- + | Generated by Apache Maven Doxia Site Renderer 1.7.4 at 2017-12-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="20171204" /> + <meta http-equiv="Content-Language" content="en" /> + <title>Apache Synapse – Apache Synapse - Sample 502</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: 2017-12-04<span class="divider">|</span> +</li> + <li id="projectVersion">Version: 3.0.1</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_502:_Transforming_Events_Before_Publish"></a>Sample 502: Transforming Events Before Publish</h2> + +<div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse"> + + <eventSource name="SampleEventSource"> + <subscriptionManager + class="org.apache.synapse.eventing.managers.DefaultInMemorySubscriptionManager"> + <!--property name="registryURL" value="http://localhost:8180/wso2registry"/> + <property name="username" value="admin"/> + <property name="password" value="admin"/--> + <property name="topicHeaderName" value="Topic"/> + <property name="topicHeaderNS" value="http://apache.org/aip"/> + </subscriptionManager> + <subscription id="mysub1"> + <filter source="synapse/event/test" + dialect="http://synapse.apache.org/eventing/dialect/topicFilter"/> + <endpoint> + <address uri="http://localhost:9000/services/SimpleStockQuoteService"/> + </endpoint> + </subscription> + </eventSource> + + <sequence name="PublicEventSource"> + <log level="full"/> + <xslt key="xslt-key-req"/> + <log level="full"/> + <eventPublisher eventSourceName="SampleEventSource"/> + </sequence> + + <proxy name="EventingProxy"> + <target inSequence="PublicEventSource"/> + </proxy> + + <localEntry key="xslt-key-req" + src="file:repository/conf/sample/resources/transform/transform_eventing.xslt"/> + +</definitions></div> + +<div class="section"> +<h3><a name="Objective"></a>Objective</h3> + +<p> + Demonstrate how to mediate and transform events before they are sent to the + target event sinks + </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 502 (repository/conf/sample/synapse_sample_502.xml) + +<div class="command"> + Unix/Linux: sh synapse.sh -sample 502<br /> + Windows: synapse.bat -sample 502 + </div> + </li> + </ul> + + </div> + +<div class="section"> +<h3><a name="Executing_the_Client"></a>Executing the Client</h3> + +<p> + In this sample, the event (order request) is transformed into a new order with + a different namesapce using the XSLT mediator. Invoke the client as follows. + </p> + +<div class="command">ant eventsender</div> + +<p> + Event will be mediated through the 'PublicEventSource' sequence and get transformed + before it gets published to the event sink (Axis2 server). + </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–2017 +<a href="http://www.apache.org/">Apache Software Foundation</a>. +All rights reserved.</p> + </div> + </div> + </footer> + </body> +</html> Added: synapse/site/3_0_1/userguide/samples/sample51.html URL: http://svn.apache.org/viewvc/synapse/site/3_0_1/userguide/samples/sample51.html?rev=1817077&view=auto ============================================================================== --- synapse/site/3_0_1/userguide/samples/sample51.html (added) +++ synapse/site/3_0_1/userguide/samples/sample51.html Mon Dec 4 09:53:57 2017 @@ -0,0 +1,302 @@ +<!DOCTYPE html> +<!-- + | Generated by Apache Maven Doxia Site Renderer 1.7.4 at 2017-12-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="20171204" /> + <meta http-equiv="Content-Language" content="en" /> + <title>Apache Synapse – Apache Synapse - Sample 51</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: 2017-12-04<span class="divider">|</span> +</li> + <li id="projectVersion">Version: 3.0.1</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_51:_MTOM_and_SwA_Optimizations_and_RequestResponse_Correlation"></a>Sample 51: MTOM and SwA Optimizations and Request/Response Correlation</h2> + +<div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse"> + + <sequence name="main"> + <in> + <filter source="get-property('Action')" regex="urn:uploadFileUsingMTOM"> + <then> + <property name="example" value="mtom"/> + <send> + <endpoint> + <address uri="http://localhost:9000/services/MTOMSwASampleService" + optimize="mtom"/> + </endpoint> + </send> + </then> + </filter> + <filter source="get-property('Action')" regex="urn:uploadFileUsingSwA"> + <then> + <property name="example" value="swa"/> + <send> + <endpoint> + <address uri="http://localhost:9000/services/MTOMSwASampleService" + optimize="swa"/> + </endpoint> + </send> + </then> + </filter> + </in> + <out> + <filter source="get-property('example')" regex="mtom"> + <then> + <property name="enableMTOM" value="true" scope="axis2"/> + </then> + </filter> + <filter source="get-property('example')" regex="swa"> + <then> + <property name="enableSwA" value="true" scope="axis2"/> + </then> + </filter> + <send/> + </out> + </sequence> + +</definitions></div> + +<div class="section"> +<h3><a name="Objective"></a>Objective</h3> + +<p> + Demonstrate the use of content optimization mechanisms like MTOM and SwA with + Synapse. + </p> + </div> + +<div class="section"> +<h3><a name="Pre-requisites"></a>Pre-requisites</h3> + +<p> + </p> +<ul> + +<li> + Deploy the MTOMSwASampleService in the sample Axis2 server and start Axis2 + </li> + +<li> + Start Synapse using the configuration numbered 51 (repository/conf/sample/synapse_sample_51.xml) + +<div class="command"> + Unix/Linux: sh synapse.sh -sample 51<br /> + Windows: synapse.bat -sample 51 + </div> + </li> + </ul> + + </div> + +<div class="section"> +<h3><a name="Executing_the_Client"></a>Executing the Client</h3> + +<p> + Execute the client as follows to send a MTOM optimized request to Synapse. + </p> + +<div class="command">ant optimizeclient -Dopt_mode=mtom</div> + +<p> + Synapse sets a local message context property, and forwards the message to + 'http://localhost:9000/services/MTOMSwASampleService', while optimizing binary + content as MTOM. By sending this message through TCPMon you will be able to see + the actual message sent by Synapse if required. + </p> + +<div class="consoleOutput">POST /services/MTOMSwASampleService HTTP/1.1 +Host: 127.0.0.1 +SOAPAction: urn:uploadFileUsingMTOM +Content-Type: multipart/related; boundary=MIMEBoundaryurn_uuid_B94996494E1DD5F9B51177413845353; type="application/xop+xml"; +start="<0.urn:uuid:b94996494e1dd5f9b51177413845...@apache.org>"; start-info="text/xml"; charset=UTF-8 +Transfer-Encoding: chunked +Connection: Keep-Alive +User-Agent: Synapse-HttpComponents-NIO + +--MIMEBoundaryurn_uuid_B94996494E1DD5F9B51177413845353241 +Content-Type: application/xop+xml; charset=UTF-8; type="text/xml" +Content-Transfer-Encoding: binary +Content-ID: + <0.urn:uuid:b94996494e1dd5f9b51177413845...@apache.org>221b1 + <?xml version='1.0' encoding='UTF-8'?> + <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> + <soapenv:Body> + <m0:uploadFileUsingMTOM xmlns:m0="http://www.apache-synapse.org/test"> + <m0:request> + <m0:image> + <xop:Include href="cid:1.urn:uuid:78f94bc50b68d76fb41177413845...@apache.org" xmlns:xop="http://www.w3.org/2004/08/xop/include" /> + </m0:image> + </m0:request> + </m0:uploadFileUsingMTOM> + </soapenv:Body> + </soapenv:Envelope> +--MIMEBoundaryurn_uuid_B94996494E1DD5F9B51177413845353217 +Content-Type: image/gif +Content-Transfer-Encoding: binary +Content-ID: + <1.urn:uuid:78f94bc50b68d76fb41177413845...@apache.org>22800GIF89a... << binary content >></div> + +<p> + During response processing, by checking the local message property Synapse can + discover past information about the current message context, and use this + knowledge to send the response back to the client in the same format as the + original request. + </p> + +<p> + When the client executes successfully, it will upload a file containing the ASF + logo and receive a response which is savesd a temporary file. + </p> + +<div class="consoleOutput">[java] Sending file : ./../../repository/conf/sample/resources/mtom/asf-logo.gif as MTOM +[java] Saved response to file : ./../../work/temp/sampleClient/mtom-4417.gif</div> + + +<p> + Now invoke the client as follows to send a SwA optimized request. + </p> + +<div class="command">ant optimizeclient -Dopt_mode=swa</div> + +<p> + This is identical to the previous invocation with only difference being the use + of SwA (SOAP with Attachement) instead of MTOM for content optimization. You + will get an output similar to following. + </p> + +<div class="consoleOutput">[java] Sending file : ./../../repository/conf/sample/resources/mtom/asf-logo.gif as SwA +[java] Saved response to file : ./../../work/temp/sampleClient/swa-30391.gif</div> + +<p> + By using TCPMon and sending the message through it, one can see that the + requests and responses sent are indeed sent as HTTP attachments as follows. + </p> + + +<div class="consoleOutput">POST /services/MTOMSwASampleService HTTP/1.1 +Host: 127.0.0.1 +SOAPAction: urn:uploadFileUsingSwA +Content-Type: multipart/related; boundary=MIMEBoundaryurn_uuid_B94996494E1DD5F9B51177414170491; type="text/xml"; +start="<0.urn:uuid:b94996494e1dd5f9b51177414170...@apache.org>"; charset=UTF-8 +Transfer-Encoding: chunked +Connection: Keep-Alive +User-Agent: Synapse-HttpComponents-NIO + +--MIMEBoundaryurn_uuid_B94996494E1DD5F9B51177414170491225 +Content-Type: text/xml; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Content-ID: + <0.urn:uuid:b94996494e1dd5f9b51177414170...@apache.org>22159 + <?xml version='1.0' encoding='UTF-8'?> + <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> + <soapenv:Body> + <m0:uploadFileUsingSwA xmlns:m0="http://www.apache-synapse.org/test"> + <m0:request> + <m0:imageId>urn:uuid:15FD2DA2584A32BF7C1177414169826</m0:imageId> + </m0:request> + </m0:uploadFileUsingSwA> + </soapenv:Body> + </soapenv:Envelope>22--34MIMEBoundaryurn_uuid_B94996494E1DD5F9B511774141704912 +17 +Content-Type: image/gif +Content-Transfer-Encoding: binary +Content-ID: + <urn:uuid:15FD2DA2584A32BF7C1177414169826>22800GIF89a... << binary content >></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–2017 +<a href="http://www.apache.org/">Apache Software Foundation</a>. +All rights reserved.</p> + </div> + </div> + </footer> + </body> +</html> Added: synapse/site/3_0_1/userguide/samples/sample52.html URL: http://svn.apache.org/viewvc/synapse/site/3_0_1/userguide/samples/sample52.html?rev=1817077&view=auto ============================================================================== --- synapse/site/3_0_1/userguide/samples/sample52.html (added) +++ synapse/site/3_0_1/userguide/samples/sample52.html Mon Dec 4 09:53:57 2017 @@ -0,0 +1,251 @@ +<!DOCTYPE html> +<!-- + | Generated by Apache Maven Doxia Site Renderer 1.7.4 at 2017-12-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="20171204" /> + <meta http-equiv="Content-Language" content="en" /> + <title>Apache Synapse – Apache Synapse - Sample 52</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: 2017-12-04<span class="divider">|</span> +</li> + <li id="projectVersion">Version: 3.0.1</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_52:_Session-less_Load_Balancing_Between_3_Endpoints"></a>Sample 52: Session-less Load Balancing Between 3 Endpoints</h2> + +<div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse"> + + <sequence name="main" onError="errorHandler"> + <in> + <send> + <endpoint> + <loadbalance> + <endpoint> + <address uri="http://localhost:9001/services/LBService1"> + <enableAddressing/> + <suspendDurationOnFailure>60</suspendDurationOnFailure> + </address> + </endpoint> + <endpoint> + <address uri="http://localhost:9002/services/LBService1"> + <enableAddressing/> + <suspendDurationOnFailure>60</suspendDurationOnFailure> + </address> + </endpoint> + <endpoint> + <address uri="http://localhost:9003/services/LBService1"> + <enableAddressing/> + <suspendDurationOnFailure>60</suspendDurationOnFailure> + </address> + </endpoint> + </loadbalance> + </endpoint> + </send> + <drop/> + </in> + + <out> + <!-- Send the messages where they have been sent (i.e. implicit To EPR) --> + <send/> + </out> + </sequence> + + <sequence name="errorHandler"> + <makefault response="true"> + <code xmlns:tns="http://www.w3.org/2003/05/soap-envelope" value="tns:Receiver"/> + <reason value="COULDN'T SEND THE MESSAGE TO THE SERVER."/> + </makefault> + <send/> + </sequence> + +</definitions></div> + +<div class="section"> +<h3><a name="Objective"></a>Objective</h3> + +<p> + Demonstrate the ability of Synapse to act as a load balancer for a set of + servers hosting stateless services + </p> + </div> + +<div class="section"> +<h3><a name="Pre-requisites"></a>Pre-requisites</h3> + +<p> + </p> +<ul> + +<li> + Deploy the LoadbalanceFailoverService in the sample Axis2 server (go to + samples/axis2Server/src/LoadbalanceFailoverService and run 'ant') + </li> + +<li> + Start 3 instances of the Axis2 server on different ports as follows + +<div class="command">./axis2server.sh -http 9001 -https 9005 -name MyServer1<br /> +./axis2server.sh -http 9002 -https 9006 -name MyServer2<br /> +./axis2server.sh -http 9003 -https 9007 -name MyServer3</div> + </li> + +<li> + Start Synapse using the configuration numbered 52 (repository/conf/sample/synapse_sample_52.xml) + +<div class="command"> + Unix/Linux: sh synapse.sh -sample 52<br /> + Windows: synapse.bat -sample 52 + </div> + </li> + </ul> + + </div> + +<div class="section"> +<h3><a name="Executing_the_Client"></a>Executing the Client</h3> + +<p> + Invoke the sample client as follows + </p> + +<div class="command">ant loadbalancefailover -Di=100</div> + +<p> + This will send 100 requests to the LoadbalanceFailoverService through Synapse. + Synapse will distribute the load among the three endpoints mentioned in the + configuration in round-robin manner. LoadbalanceFailoverService appends the name + of the server to the response, so that client can determine which server has + processed the message. If you examine the console output of the client, you can + see that requests are processed by three servers as follows: + </p> + +<div class="consoleOutput">[java] Request: 1 ==> Response from server: MyServer1 +[java] Request: 2 ==> Response from server: MyServer2 +[java] Request: 3 ==> Response from server: MyServer3 +[java] Request: 4 ==> Response from server: MyServer1 +[java] Request: 5 ==> Response from server: MyServer2 +[java] Request: 6 ==> Response from server: MyServer3 +[java] Request: 7 ==> Response from server: MyServer1 +...</div> + +<p> + Now run the client without the -Di=100 parameter to send requests indefinitely. + While running the client shutdown the server named MyServer1. Then you can observe + that requests are only distributed among MyServer2 and MyServer3. Console output + before and after shutting down MyServer1 is listed below (MyServer1 was shutdown + after request 63): + </p> + +<div class="consoleOutput">... +[java] Request: 61 ==> Response from server: MyServer1 +[java] Request: 62 ==> Response from server: MyServer2 +[java] Request: 63 ==> Response from server: MyServer3 +[java] Request: 64 ==> Response from server: MyServer2 +[java] Request: 65 ==> Response from server: MyServer3 +[java] Request: 66 ==> Response from server: MyServer2 +[java] Request: 67 ==> Response from server: MyServer3 +...</div> + +<p> + Now restart MyServer1. You can observe that requests will be again sent to all + three servers within 60 seconds. This is because we have specified + <suspendDurationOnFailure> as 60 seconds in the configuration. Therefore, + load balance endpoint will suspend any failed child endpoint only for 60 seconds + after detecting the failure. + </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–2017 +<a href="http://www.apache.org/">Apache Software Foundation</a>. +All rights reserved.</p> + </div> + </div> + </footer> + </body> +</html> Added: synapse/site/3_0_1/userguide/samples/sample53.html URL: http://svn.apache.org/viewvc/synapse/site/3_0_1/userguide/samples/sample53.html?rev=1817077&view=auto ============================================================================== --- synapse/site/3_0_1/userguide/samples/sample53.html (added) +++ synapse/site/3_0_1/userguide/samples/sample53.html Mon Dec 4 09:53:57 2017 @@ -0,0 +1,243 @@ +<!DOCTYPE html> +<!-- + | Generated by Apache Maven Doxia Site Renderer 1.7.4 at 2017-12-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="20171204" /> + <meta http-equiv="Content-Language" content="en" /> + <title>Apache Synapse – Apache Synapse - Sample 53</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: 2017-12-04<span class="divider">|</span> +</li> + <li id="projectVersion">Version: 3.0.1</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_53:_Fail-over_Routing_Among_3_Endpoints"></a>Sample 53: Fail-over Routing Among 3 Endpoints</h2> + +<div class="xmlConf"><definitions xmlns="http://ws.apache.org/ns/synapse"> + + <sequence name="main" onError="errorHandler"> + <in> + <send> + <endpoint> + <failover> + <endpoint> + <address uri="http://localhost:9001/services/LBService1"> + <enableAddressing/> + <suspendDurationOnFailure>60</suspendDurationOnFailure> + </address> + </endpoint> + <endpoint> + <address uri="http://localhost:9002/services/LBService1"> + <enableAddressing/> + <suspendDurationOnFailure>60</suspendDurationOnFailure> + </address> + </endpoint> + <endpoint> + <address uri="http://localhost:9003/services/LBService1"> + <enableAddressing/> + <suspendDurationOnFailure>60</suspendDurationOnFailure> + </address> + </endpoint> + </failover> + </endpoint> + </send> + <drop/> + </in> + + <out> + <!-- Send the messages where they have been sent (i.e. implicit To EPR) --> + <send/> + </out> + </sequence> + + <sequence name="errorHandler"> + <makefault response="true"> + <code xmlns:tns="http://www.w3.org/2003/05/soap-envelope" value="tns:Receiver"/> + <reason value="COULDN'T SEND THE MESSAGE TO THE SERVER."/> + </makefault> + <send/> + </sequence> + +</definitions></div> + +<div class="section"> +<h3><a name="Objective"></a>Objective</h3> + +<p> + Demonstrate the fail-over routing capabilities of Synapse. In fail-over routing + messages are sent to a designated primary endpoint. When the primary endpoint + fails, Synapse fails over to the one of the backup endpoints. + </p> + </div> + +<div class="section"> +<h3><a name="Pre-requisites"></a>Pre-requisites</h3> + +<p> + </p> +<ul> + +<li> + Deploy the LoadbalanceFailoverService in the sample Axis2 server (go to + samples/axis2Server/src/LoadbalanceFailoverService and run 'ant') + </li> + +<li> + Start 3 instances of the Axis2 server on different ports as follows + +<div class="command">./axis2server.sh -http 9001 -https 9005 -name MyServer1<br /> +./axis2server.sh -http 9002 -https 9006 -name MyServer2<br /> +./axis2server.sh -http 9003 -https 9007 -name MyServer3</div> + </li> + +<li> + Start Synapse using the configuration numbered 53 (repository/conf/sample/synapse_sample_53.xml) + +<div class="command"> + Unix/Linux: sh synapse.sh -sample 53<br /> + Windows: synapse.bat -sample 53 + </div> + </li> + </ul> + + </div> + +<div class="section"> +<h3><a name="Executing_the_Client"></a>Executing the Client</h3> + +<p> + Above configuration sends messages with the fail-over behavior. Initially the + server at port 9001 is treated as primary and other two are treated as backups. + Messages are always directed only to the primary server. If the primary server + fails, next listed server is selected as the primary. Thus, messages are sent + successfully as long as there is at least one active server. To test this, run + the loadbalancefailover client to send infinite requests as follows: + </p> + +<div class="command">ant loadbalancefailover</div> + +<p> + You can see that all requests are processed by MyServer1. Now shutdown MyServer1 + and inspect the console output of the client. You will observe that all subsequent + requests are processed by MyServer2. (MyServer 1 was shutdown after request 127) + </p> + +<div class="consoleOutput">... +[java] Request: 125 ==> Response from server: MyServer1 +[java] Request: 126 ==> Response from server: MyServer1 +[java] Request: 127 ==> Response from server: MyServer1 +[java] Request: 128 ==> Response from server: MyServer2 +[java] Request: 129 ==> Response from server: MyServer2 +[java] Request: 130 ==> Response from server: MyServer2 +...</div> + +<p> + You can keep on shutting servers down like this. Client will get a response untill + you shutdown all listed servers. Once all servers are shutdown, the error sequence + is triggered and a fault message is sent to the client as follows. + </p> + +<div class="consoleOutput">[java] COULDN'T SEND THE MESSAGE TO THE SERVER.</div> + +<p> + Once a server is detected as failed, it will be added to the active servers + list again after 60 seconds (specified in <suspendDurationOnFailure> in + the configuration). Therefore, if you have restarted any of the stopped servers, + messages will be directed to the newly started server within 60 seconds. + </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–2017 +<a href="http://www.apache.org/">Apache Software Foundation</a>. +All rights reserved.</p> + </div> + </div> + </footer> + </body> +</html>