Author: hiranya
Date: Tue Nov 30 22:17:54 2010
New Revision: 1040810
URL: http://svn.apache.org/viewvc?rev=1040810&view=rev
Log:
Sample 56, 57, 58
Modified:
synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples.xml
synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample56.xml
synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample57.xml
synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample58.xml
Modified:
synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples.xml
URL:
http://svn.apache.org/viewvc/synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples.xml?rev=1040810&r1=1040809&r2=1040810&view=diff
==============================================================================
--- synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples.xml
(original)
+++ synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples.xml
Tue Nov 30 22:17:54 2010
@@ -62,10 +62,10 @@
<li><a href="samples/sample52.html">Sample 52: Session
less load balancing between 3 endpoints</a></li>
<li><a href="samples/sample53.html">Sample 53:
Fail-over routing among 3 endpoints</a></li>
<li><a href="samples/sample54.html">Sample 54: Session
affinity load balancing between 3 endpoints</a></li>
- <li><a href="samples/sample55.html">Sample 55: Session
affinity load balancing between fail over endpoints</a></li>
- <li><a href="">Sample 56: WSDL endpoint</a></li>
- <li><a href="">Sample 57: Dynamic load balancing
between 3 nodes</a></li>
- <li><a href="">Sample 58: Static load balancing
between 3 nodes</a></li>
+ <li><a href="samples/sample55.html">Sample 55: Session
affinity load balancing between fail-over endpoints</a></li>
+ <li><a href="samples/sample56.html">Sample 56: WSDL
endpoint</a></li>
+ <li><a href="samples/sample57.html">Sample 57: Dynamic
load balancing between 3 nodes</a></li>
+ <li><a href="samples/sample58.html">Sample 58: Static
load balancing between 3 nodes</a></li>
</ul>
</p>
</subsection>
Modified:
synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample56.xml
URL:
http://svn.apache.org/viewvc/synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample56.xml?rev=1040810&r1=1040809&r2=1040810&view=diff
==============================================================================
---
synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample56.xml
(original)
+++
synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample56.xml
Tue Nov 30 22:17:54 2010
@@ -23,7 +23,7 @@
<title>Apache Synapse - Sample 56</title>
</properties>
<body>
- <section name="Sample 56: ">
+ <section name="Sample 56: WSDL Endpoint">
<div class="xmlConf"><definitions
xmlns="http://ws.apache.org/ns/synapse">
<sequence name="main">
@@ -46,7 +46,7 @@
</definitions></div>
<subsection name="Objective">
<p>
-
+ Showcase the ability of Synapse to use a WSDL as the
target endpoint
</p>
</subsection>
<subsection name="Pre-requisites">
@@ -66,10 +66,32 @@
</p>
</subsection>
<subsection name="Executing the Client">
- <div class="command">ant stockquote
-Daddurl=http://localhost:9000/services/SimpleStockQuoteService
-Dtrpurl=http://localhost:8280/</div>
-
- <div class="consoleOutput">Sat Nov 18 21:01:23 IST 2006
SimpleStockQuoteService :: Generating quote for : IBM</div>
-
+ <p>
+ This sample uses a WSDL endpoint inside the send mediator.
WSDL endpoints can
+ extract endpoint's address from the given WSDL. As WSDL
documents can have many
+ services and many ports inside each service, the service
and port of the
+ required endpoint has to be specified. As with address
endpoints, QoS parameters
+ for the endpoint can be specified in-line in the
configuration. An excerpt taken
+ from the sample_proxy_1.wsdl containing the specified
service and port is
+ listed below.
+ </p>
+ <div class="xmlConf"><wsdl:service
name="SimpleStockQuoteService">
+ <wsdl:port name="SimpleStockQuoteServiceHttpSoap11Endpoint"
binding="ns:SimpleStockQuoteServiceSoap11Binding">
+ <soap:address
location="http://localhost:9000/services/SimpleStockQuoteService.SimpleStockQuoteServiceHttpSoap11Endpoint"/>
+ </wsdl:port>
+ <wsdl:port name="SimpleStockQuoteServiceHttpSoap12Endpoint"
binding="ns:SimpleStockQuoteServiceSoap12Binding">
+ <soap12:address
location="http://localhost:9000/services/SimpleStockQuoteService.SimpleStockQuoteServiceHttpSoap12Endpoint"/>
+ </wsdl:port>
+</wsdl:service></div>
+ <p>
+ Specified service and port refers to the endpoint address
'http://localhost:9000/services/SimpleStockQuoteService.SimpleStockQuoteServiceHttpSoap11Endpoint'
+ according to the above WSDL. Now run the client using the
following command.
+ </p>
+ <div class="command">ant stockquote
-Daddurl=http://localhost:8280/</div>
+ <p>
+ Client will print the quote price for IBM received from
the server running on
+ port 9000.
+ </p>
<div class="consoleOutput">Standard :: Stock price =
$95.26454380258552</div>
</subsection>
</section>
Modified:
synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample57.xml
URL:
http://svn.apache.org/viewvc/synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample57.xml?rev=1040810&r1=1040809&r2=1040810&view=diff
==============================================================================
---
synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample57.xml
(original)
+++
synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample57.xml
Tue Nov 30 22:17:54 2010
@@ -23,7 +23,7 @@
<title>Apache Synapse - Sample 57</title>
</properties>
<body>
- <section name="Sample 57: ">
+ <section name="Sample 57: Dynamic Load Balancing Between 3 Nodes">
<div class="xmlConf"><definitions
xmlns="http://ws.apache.org/ns/synapse">
<sequence name="main" onError="errorHandler">
@@ -59,14 +59,31 @@
</definitions></div>
<subsection name="Objective">
<p>
-
+ Demonstrate the ability of Synapse to perform dynamic load
balancing. In
+ dynamic load balancing, nodes can be added and removed
from the pool dynamically.
</p>
</subsection>
<subsection name="Pre-requisites">
<p>
<ul>
<li>
- Deploy the SimpleStockQuoteService in the sample
Axis2 server and start Axis2
+ Deploy the LoadbalanceFailoverService by switching
to samples/axis2Server/src/LoadbalanceFailoverService
+ directory and running 'ant'.
+ </li>
+ <li>
+ Enable clustering for the sample Axis2 server.
Edit the axis2.xml file at
+ samples/axis2Server/repository/conf directory and
set the 'enable' attribute
+ on the 'clustering' element to 'true'. Specify the
IP address of the
+ machine as the values of 'mcastBindAddress' and
'localMemberHost'
+ parameters.
+ </li>
+ <li>
+ Enable clustering for Synapse by editing
repository/conf/axis2.xml file.
+ This should be done by setting the 'enable'
attribute of the 'clustering'
+ element to 'true'. Also provide the IP address of
your machine as the
+ values of the 'mcastBindAddress' and
'localMemberHost' parameters. In
+ addition also set the 'enable' attribute on
'groupManagement' element
+ to 'true'.
</li>
<li>
Start Synapse using the configuration numbered 57
(repository/conf/sample/synapse_sample_57.xml)
@@ -75,15 +92,60 @@
Windows: synapse.bat -sample 57
</div>
</li>
+ <li>
+ Start 3 instances of the sample Axis2 server as
follows.
+ <div class="command">./axis2server.sh -http 9001
-https 9005 -name MyServer1
+./axis2server.sh -http 9002 -https 9006 -name MyServer2
+./axis2server.sh -http 9003 -https 9007 -name MyServer3</div>
+ </li>
</ul>
</p>
</subsection>
<subsection name="Executing the Client">
- <div class="command">ant stockquote
-Daddurl=http://localhost:9000/services/SimpleStockQuoteService
-Dtrpurl=http://localhost:8280/</div>
-
- <div class="consoleOutput">Sat Nov 18 21:01:23 IST 2006
SimpleStockQuoteService :: Generating quote for : IBM</div>
-
- <div class="consoleOutput">Standard :: Stock price =
$95.26454380258552</div>
+ <p>
+ Note that the Synapse configuration does not define any
concrete addresses or
+ URLs as targets. They are discovered dynamically by the
dynamic load balance
+ endpoint. To test this feature start the load balance and
failover client using
+ the following command:
+ </p>
+ <div class="command">ant loadbalancefailover -Di=100</div>
+ <p>
+ This client sends 100 requests to the
LoadbalanceFailoverService through Synapse.
+ Synapse will distribute the load among the three nodes we
have started
+ 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
infinite requests. While
+ running the client shutdown the server named MyServer1.
You can observe that
+ requests are only distributed among MyServer2 and
MyServer3 after shutting down
+ MyServer1. 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. If you start a new Axis2 instance (say
MyServer4) that will also
+ be added to the load balance pool dynamically.
+ </p>
</subsection>
</section>
<p><a href="../samples.html">Back to Catalog</a></p>
Modified:
synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample58.xml
URL:
http://svn.apache.org/viewvc/synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample58.xml?rev=1040810&r1=1040809&r2=1040810&view=diff
==============================================================================
---
synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample58.xml
(original)
+++
synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample58.xml
Tue Nov 30 22:17:54 2010
@@ -23,7 +23,7 @@
<title>Apache Synapse - Sample 58</title>
</properties>
<body>
- <section name="Sample 58: ">
+ <section name="Sample 58: Static Load Balancing Between 3 Nodes">
<div class="xmlConf"><definitions
xmlns="http://ws.apache.org/ns/synapse">
<sequence name="main" onError="errorHandler">
@@ -57,31 +57,76 @@
</definitions></div>
<subsection name="Objective">
<p>
-
+ Demonstrate the ability of Synapse to act as a load
balancer for a set of
+ servers hosting stateless services. This sample is very
similar to
+ <a href="sample52.html">sample 52</a> but uses a different
syntax style to
+ configure the load balance endpoint.
</p>
</subsection>
<subsection name="Pre-requisites">
<p>
<ul>
<li>
- Deploy the SimpleStockQuoteService in the sample
Axis2 server and start Axis2
+ 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
+./axis2server.sh -http 9002 -https 9006 -name MyServer2
+./axis2server.sh -http 9003 -https 9007 -name MyServer3</div>
</li>
<li>
- Start Synapse using the configuration numbered 58
(repository/conf/sample/synapse_sample_58.xml)
+ Start Synapse using the configuration numbered 52
(repository/conf/sample/synapse_sample_52.xml)
<div class="command">
- Unix/Linux: sh synapse.sh -sample 58<br/>
- Windows: synapse.bat -sample 58
+ Unix/Linux: sh synapse.sh -sample 52<br/>
+ Windows: synapse.bat -sample 52
</div>
</li>
</ul>
</p>
</subsection>
<subsection name="Executing the Client">
- <div class="command">ant stockquote
-Daddurl=http://localhost:9000/services/SimpleStockQuoteService
-Dtrpurl=http://localhost:8280/</div>
-
- <div class="consoleOutput">Sat Nov 18 21:01:23 IST 2006
SimpleStockQuoteService :: Generating quote for : IBM</div>
-
- <div class="consoleOutput">Standard :: Stock price =
$95.26454380258552</div>
+ <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.
+ </p>
</subsection>
</section>
<p><a href="../samples.html">Back to Catalog</a></p>