Author: indika
Date: Wed Nov 7 02:16:24 2007
New Revision: 592682
URL: http://svn.apache.org/viewvc?rev=592682&view=rev
Log:
modify the samples
add document for sample 372
Modified:
webservices/synapse/branches/1.1/repository/conf/sample/resources/policy/throttle_policy.xml
webservices/synapse/branches/1.1/repository/conf/sample/synapse_sample_371.xml
webservices/synapse/branches/1.1/repository/conf/sample/synapse_sample_372.xml
webservices/synapse/branches/1.1/src/site/resources/Synapse_Samples.html
Modified:
webservices/synapse/branches/1.1/repository/conf/sample/resources/policy/throttle_policy.xml
URL:
http://svn.apache.org/viewvc/webservices/synapse/branches/1.1/repository/conf/sample/resources/policy/throttle_policy.xml?rev=592682&r1=592681&r2=592682&view=diff
==============================================================================
---
webservices/synapse/branches/1.1/repository/conf/sample/resources/policy/throttle_policy.xml
(original)
+++
webservices/synapse/branches/1.1/repository/conf/sample/resources/policy/throttle_policy.xml
Wed Nov 7 02:16:24 2007
@@ -8,7 +8,7 @@
<wsp:All>
<throttle:MaximumCount>4</throttle:MaximumCount>
<throttle:UnitTime>800000</throttle:UnitTime>
- <throttle:ProhibitTimePeriod
wsp:Optional="true">10000</throttle:ProhibitTimePeriod>
+ <throttle:ProhibitTimePeriod
wsp:Optional="true">1000</throttle:ProhibitTimePeriod>
</wsp:All>
<throttle:IsAllow>true</throttle:IsAllow>
</wsp:ExactlyOne>
Modified:
webservices/synapse/branches/1.1/repository/conf/sample/synapse_sample_371.xml
URL:
http://svn.apache.org/viewvc/webservices/synapse/branches/1.1/repository/conf/sample/synapse_sample_371.xml?rev=592682&r1=592681&r2=592682&view=diff
==============================================================================
---
webservices/synapse/branches/1.1/repository/conf/sample/synapse_sample_371.xml
(original)
+++
webservices/synapse/branches/1.1/repository/conf/sample/synapse_sample_371.xml
Wed Nov 7 02:16:24 2007
@@ -27,7 +27,6 @@
<wsp:Policy
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:throttle="http://www.wso2.org/products/wso2commons/throttle">
<throttle:ThrottleAssertion>
-
<throttle:MaximumConcurrentAccess>10</throttle:MaximumConcurrentAccess>
<wsp:All>
<throttle:ID
throttle:type="IP">Other</throttle:ID>
<wsp:ExactlyOne>
Modified:
webservices/synapse/branches/1.1/repository/conf/sample/synapse_sample_372.xml
URL:
http://svn.apache.org/viewvc/webservices/synapse/branches/1.1/repository/conf/sample/synapse_sample_372.xml?rev=592682&r1=592681&r2=592682&view=diff
==============================================================================
---
webservices/synapse/branches/1.1/repository/conf/sample/synapse_sample_372.xml
(original)
+++
webservices/synapse/branches/1.1/repository/conf/sample/synapse_sample_372.xml
Wed Nov 7 02:16:24 2007
@@ -17,19 +17,15 @@
~ under the License.
-->
-<!-- TODO: Find the topic -->
+<!-- Use of both concurrency throttling and request rate based throttling -->
<definitions xmlns="http://ws.apache.org/ns/synapse">
<registry provider="org.apache.synapse.registry.url.SimpleURLRegistry">
<!-- the root property of the simple URL registry helps resolve a
resource URL as root + key -->
<parameter name="root">file:repository/</parameter>
<!-- all resources loaded from the URL registry would be cached for
this number of milli seconds -->
- <parameter name="cachableDuration">15000</parameter>
+ <parameter name="cachableDuration">150000</parameter>
</registry>
-
-
- <localEntry key="thottlePolicy"
-
src="file:./repository/conf/sample/resources/policy/throttle_policy.xml"/>
<sequence name="onAcceptSequence">
<log level="custom">
Modified:
webservices/synapse/branches/1.1/src/site/resources/Synapse_Samples.html
URL:
http://svn.apache.org/viewvc/webservices/synapse/branches/1.1/src/site/resources/Synapse_Samples.html?rev=592682&r1=592681&r2=592682&view=diff
==============================================================================
--- webservices/synapse/branches/1.1/src/site/resources/Synapse_Samples.html
(original)
+++ webservices/synapse/branches/1.1/src/site/resources/Synapse_Samples.html
Wed Nov 7 02:16:24 2007
@@ -254,7 +254,8 @@
mediator and concurrency throttling</a></li>
<li><a href="#Sample371">Sample 371: Restricting requests based on
policies</a></li>
- <li><a href="#Sample372">Sample 372: TODO: Find the topic</a></li>
+ <li><a href="#Sample372">Sample 372: Use of both concurrency
+ throttling and request rate based throttling </a></li>
</ul>
</li>
<li><a href="#Class">Extending the mediation in java (Class
@@ -269,7 +270,8 @@
<ul>
<li><a href="#Sample390">Sample 390: Introduction to the XQuery
mediator</a></li>
- <li><a href="#Sample391">Sample 391: TODO: Find the topic</a></li>
+ <li><a href="#Sample391">Sample 391: How to use the data from an
+ external XML document with in XQuery </a></li>
</ul>
</li>
<li><a href="#Splitter">Splitting messages in to parts and process in
@@ -285,10 +287,10 @@
aggregating the responses</a></li>
</ul>
</li>
- <li><a href="#Cache">Caching the responses over the requests</a>
+ <li><a href="#Cache">Caching the responses over the requests</a>
<ul>
<li><a href="#Sample420">Sample 420: Simple cache implemented on
- synapse for the actual service</a></li>
+ synapse for the actual service</a></li>
</ul>
</li>
</ul>
@@ -2925,20 +2927,23 @@
</definitions></pre>
-<p><strong>Objective: Introduce the concept of tasks and how simple trigger
works</strong></p>
+<p><strong>Objective: Introduce the concept of tasks and how simple trigger
+works</strong></p>
<p><strong>Prerequisites:</strong><br>
-You will need access to build the SimpleStockQuoteService as mentioned in the
above and start the
-sample axis2 server before staring synapse.</p>
+You will need access to build the SimpleStockQuoteService as mentioned in the
+above and start the sample axis2 server before staring synapse.</p>
-<p>When ever synapse gets started and initialized, this task will run
periodically in 5 second
-intervals. You could limit the number of times that you want to run this task
by adding a count
-attribute with an integer as the value, if the count is not present as in this
sample this task will
-run forever.</p>
-
-<p>One can write his own task class implmenting the
org.apache.synapse.startup.Task interface and
-implementing the execute method to do the task. For this particualr sample we
have used the
-MessageInjector which just injects a message specified in to the synapse
enviorenemnt.</p>
+<p>When ever synapse gets started and initialized, this task will run
+periodically in 5 second intervals. You could limit the number of times that
+you want to run this task by adding a count attribute with an integer as the
+value, if the count is not present as in this sample this task will run
+forever.</p>
+
+<p>One can write his own task class implmenting the
+org.apache.synapse.startup.Task interface and implementing the execute method
+to do the task. For this particualr sample we have used the MessageInjector
+which just injects a message specified in to the synapse enviorenemnt.</p>
<h1><a name="AdvancedMediation">Advanced mediations with advanced
mediators</a></h1>
@@ -3194,7 +3199,7 @@
<p>create table company(name varchar(10), id varchar(10), price
double);</p>
</li>
- <li>Inserts some data using following statements
+ <li>Inserts some data using following statements
<p>insert into company values ('IBM','c1',0.0);</p>
<p>insert into company values ('SUN','c2',0.0);</p>
<p>insert into company values ('MSFT','c3',0.0);</p>
@@ -3539,8 +3544,8 @@
<h2><a name="Throttle">Throtteling messages (Throttle Mediator)</a></h2>
<!-- TODO: any text to go in here??? -->
-<h2><a name="Sample370">Sample 370: Introduction to throttle
-mediator and concurrency throttling</a></h2>
+<h2><a name="Sample370">Sample 370: Introduction to throttle mediator and
+concurrency throttling</a></h2>
<pre><definitions xmlns="http://ws.apache.org/ns/synapse">
<sequence name="main">
<in>
@@ -3611,7 +3616,8 @@
synapse. For synapse with above configuration ,if client send 20 request
concurrently ,then approximately half of those will success..</p>
-<h2><a name="Sample371">Sample 371: Restricting requests based on policies
</a></h2>
+<h2><a name="Sample371">Sample 371: Restricting requests based on policies
+</a></h2>
<pre><definitions xmlns="http://ws.apache.org/ns/synapse">
<sequence name="main">
<in>
@@ -3620,9 +3626,7 @@
<!-- define throttle policy -->
<wsp:Policy
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:throttle="http://www.wso2.org/products/wso2commons/throttle">
- <throttle:ThrottleAssertion>
-
<throttle:MaximumConcurrentAccess>10</throttle:MaximumConcurrentAccess>
- <wsp:All>
+ <throttle:ThrottleAssertion> <br>
<wsp:All>
<throttle:ID
throttle:type="IP">Other</throttle:ID>
<wsp:ExactlyOne>
<wsp:All>
@@ -3744,15 +3748,97 @@
[HttpServerWorker-4] INFO LogMediator - text = **Access Accept**
[HttpServerWorker-5] INFO LogMediator - text = **Access Denied** </pre>
-<h2><a name="Sample372">Sample 372: TODO: Find the topic</a></h2>
-
+<h2><a name="Sample372">Sample 372:Use of both concurrency throttling and
+request rate based throttling </a></h2>
<!-- TODO: what goes here -->
-<h2><a name="Class">Extending the mediation in java (Class Mediator)</a></h2>
+<div>
+</div>
+<pre><!-- Use of both concurrency throttling and request rate based
throttling -->
+<definitions xmlns="http://ws.apache.org/ns/synapse">
+
+ <registry
provider="org.apache.synapse.registry.url.SimpleURLRegistry">
+ <!-- the root property of the simple URL registry helps resolve a
resource URL as root + key -->
+ <parameter name="root">file:repository/</parameter>
+ <!-- all resources loaded from the URL registry would be cached for
this number of milli seconds -->
+ <parameter name="cachableDuration">150000</parameter>
+ </registry>
+
+ <sequence name="onAcceptSequence">
+ <log level="custom">
+ <property name="text" value="**Access Accept**"/>
+ </log>
+ <send>
+ <endpoint>
+ <address
uri="http://localhost:9000/soap/SimpleStockQuoteService"/>
+ </endpoint>
+ </send>
+ </sequence>
+ <sequence name="onRejectSequence" trace="enable">
+ <log level="custom">
+ <property name="text" value="**Access Denied**"/>
+ </log>
+ <makefault>
+ <code value="tns:Receiver"
+ xmlns:tns="http://www.w3.org/2003/05/soap-envelope"/>
+ <reason value="**Access Denied**"/>
+ </makefault>
+ <property name="RESPONSE" value="true"/>
+ <header name="To" action="remove"/>
+ <send/>
+ <drop/>
+ </sequence>
+ <proxy name="StockQuoteProxy">
+ <target>
+ <inSequence>
+ <throttle onReject="onRejectSequence"
onAccept="onAcceptSequence" id="A">
+ <policy
key="conf/sample/resources/policy/throttle_policy.xml"/>
+ </throttle>
+ </inSequence>
+ <outSequence>
+ <throttle id="A"/>
+ <send/>
+ </outSequence>
+ </target>
+ <publishWSDL
uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/>
+ </proxy>
+</definitions>
+</pre>
+
+<div>
+</div>
+
+<p><strong>Objective: Use of both concurrency throttling and request rate
+based throttling </strong></p>
+
+<p><strong>Prerequisites:</strong> Deploy the SimpleStockQuoteService in
+sample Axis2 server and start it on port 9000.</p>
+
+<p>Start Synapse with the sample configuration 372 (i.e. synapse -sample
+372).</p>
+
+<p></p>
+
+<p>Throttle policy is loaded from the “throttle_policy. xml”
+.That policy contains merging policy from sample 370 and 371. To check the
+functionality , it is need to run load test.The all enabled request from the
+concurrency throttling will be controlled by the access rate base throttling
+according to the policy.</p>
+
+<p>Run the client as follows </p>
+<pre>ant stockquote -Daddurl=http://localhost:8080/soap/StockQuoteProxy</pre>
+<div>
+<p>You will get results same as sample 371.if you run the load test, results
+will be different due to affect of concurrency throttling.</p>
+</div>
+
+<h2><a name="Class">Extending the mediation in java (Class
+Mediator)</a></h2>
<!-- TODO: Is there anything tpo go in here??? -->
-<h2><a name="Sample380">Sample 380: Writting your own custom mediation in
Java</a></h2>
+<h2><a name="Sample380">Sample 380: Writting your own custom mediation in
+Java</a></h2>
<pre><definitions xmlns="http://ws.apache.org/ns/synapse">
<sequence name="fault">
@@ -3923,11 +4009,12 @@
<p></p>
-<h2><a name="XQuery">Evaluating XQuery for mediation (XQuery Mediator)</a></h2>
-
+<h2><a name="XQuery">Evaluating XQuery for mediation (XQuery
+Mediator)</a></h2>
<!-- TODO: what goes in herer -->
-<h2><a name="Sample390">Sample 390: Introduction to the XQuery
mediator</a></h2>
+<h2><a name="Sample390">Sample 390: Introduction to the XQuery
+mediator</a></h2>
<pre><definitions xmlns="http://ws.apache.org/ns/synapse">
<!-- the SimpleURLRegistry allows access to a URL based registry (e.g.
file:/// or http://) -->
@@ -3988,10 +4075,11 @@
<p></p>
-<h2><a name="Sample391">Sample 391: TODO: Find the topic</a></h2>
+<h2><a name="Sample391">Sample 391: How to use data from an external XML
+document with in XQuery </a></h2>
<pre><definitions xmlns="http://ws.apache.org/ns/synapse">
- <!-- the SimpleURLRegistry allows access to a URL based registry (e.g.
file:/// or http://) -->
+ <!-- the SimpleURLRegistry allows access to URL based registry (e.g.
file:/// or http://) -->
<registry
provider="org.apache.synapse.registry.url.SimpleURLRegistry">
<!-- the root property of the simple URL registry helps resolve a
resource URL as root + key -->
<parameter
name="root">file:repository/conf/sample/resources/</parameter>
@@ -4038,12 +4126,12 @@
<p>Invoke the client as follows. </p>
<pre>ant stockquote -Daddurl=http://localhost:8080/soap/StockQuoteProxy</pre>
-<h2><a name="Splitter">Splitting messages in to parts and process in
-parallel (Iterate / Clone)</a></h2>
-
+<h2><a name="Splitter">Splitting messages in to parts and process in parallel
+(Iterate / Clone)</a></h2>
<!-- TODO: splitter declaration -->
-<h2><a name="Sample400">Sample 400: Message splitting and aggregating the
responses</a></h2>
+<h2><a name="Sample400">Sample 400: Message splitting and aggregating the
+responses</a></h2>
<pre><definitions xmlns="http://ws.apache.org/ns/synapse">
<proxy name="SplitAggregateProxy">
@@ -4080,8 +4168,9 @@
</proxy>
</definitions></pre>
-<p><b><strong>Objective: Demonstrate the use of Iterate mediator to split the
messages in to
-parts and process them asynchronously and then aggreagate the responses coming
in to synapse</strong></b></p>
+<p><b><strong>Objective: Demonstrate the use of Iterate mediator to split the
+messages in to parts and process them asynchronously and then aggreagate the
+responses coming in to synapse</strong></b></p>
<p><strong>Prerequisites:</strong>Deploy the SimpleStockQuoteService in
sample Axis2 server and start it on port 9000.</p>
@@ -4089,26 +4178,34 @@
<p>Start Synapse with the sample configuration 400 (i.e. synapse -sample
400).</p>
-<p>In this sample, the message sent to synapse has embeded with a number of
elements of the same type
-in one message. When synapse received this message it will iterate through
those elements and then sent
-to the specified endpoint. When all the responses appear in to synapse then
those messages will be
-aggregated to form the resultant response and sent back to the client.</p>
+<p>In this sample, the message sent to synapse has embeded with a number of
+elements of the same type in one message. When synapse received this message
+it will iterate through those elements and then sent to the specified
+endpoint. When all the responses appear in to synapse then those messages
+will be aggregated to form the resultant response and sent back to the
+client.</p>
<p>Invoke the client as follows. </p>
<pre>ant stockquote -Daddurl=http://localhost:8080/soap/SplitAggregateProxy
-Ditr=4</pre>
-<h2><a name="Aggregator">Aggregating messages and process in batch (Aggregate
Mediator)</a></h2>
+<h2><a name="Aggregator">Aggregating messages and process in batch (Aggregate
+Mediator)</a></h2>
-<h2><a name="Sample410">Sample 410: Message aggregation for batch
processing</a></h2>
+<h2><a name="Sample410">Sample 410: Message aggregation for batch
+processing</a></h2>
-<h2><a name="Cache">Caching the responses over the requests (Cache
Mediator)</a></h2>
+<h2><a name="Cache">Caching the responses over the requests (Cache
+Mediator)</a></h2>
-<p>Cached mediator can be used to utilize the network bandwidth, to protect
the backend service from
-being loaded with the same type of requests like browser refresh and also to
speed up the
-execution of the webservice. This mediator should be used with sence, because
it is not applicable
-for each and every services (for example services with dynamic responses for a
particular release)</p>
+<p>Cached mediator can be used to utilize the network bandwidth, to protect
+the backend service from being loaded with the same type of requests like
+browser refresh and also to speed up the execution of the webservice. This
+mediator should be used with sence, because it is not applicable for each and
+every services (for example services with dynamic responses for a particular
+release)</p>
-<h2><a name="Sample420">Sample 420: Simple cache implemented on synapse for
the actual service</a></h2>
+<h2><a name="Sample420">Sample 420: Simple cache implemented on synapse for
+the actual service</a></h2>
<pre><definitions xmlns="http://ws.apache.org/ns/synapse">
<in>
<cache timeout="20000" scope="per-host"
@@ -4127,8 +4224,9 @@
</out>
</definitions></pre>
-<p><b><strong>Objective: Demonstrate the use of Cache mediator in order to
cache the
-response and use that cached response as the response for an identical xml
request</strong></b></p>
+<p><b><strong>Objective: Demonstrate the use of Cache mediator in order to
+cache the response and use that cached response as the response for an
+identical xml request</strong></b></p>
<p><strong>Prerequisites:</strong>Deploy the SimpleStockQuoteService in
sample Axis2 server and start it on port 9000.</p>
@@ -4136,21 +4234,22 @@
<p>Start Synapse with the sample configuration 420 (i.e. synapse -sample
420).</p>
-<p>In this sample, the message sent to synapse is checked for an existing
cached response by
-calculating the hash value of the request. If there is a cache hit in synapse
then this request
-will not be forwarded to the actual service, rather synapse respond to the
client with the
-cached response. In case of a cache miss that particular message will be
forwarded to the actual
-service and cached that response in the out path for the use of consecutive
requests of the
-same type.</p>
+<p>In this sample, the message sent to synapse is checked for an existing
+cached response by calculating the hash value of the request. If there is a
+cache hit in synapse then this request will not be forwarded to the actual
+service, rather synapse respond to the client with the cached response. In
+case of a cache miss that particular message will be forwarded to the actual
+service and cached that response in the out path for the use of consecutive
+requests of the same type.</p>
<p>To observe this behaviour, invoke the client as follows. </p>
<pre>ant stockquote -Dtrpurl=http://localhost:8080/</pre>
-<p>You could notice that if you send more than one requests withing 20 seconds
only the first request
-is forwarded to the actual service, and the rest of the requests will be
served by the cache inside
-syanpse. You could observe this by looking at the priting line of the axis2
server, as well as by
-observing a constant rate as the response to the client instead of the random
rate, which changes by
-each and every 20 seconds.</p>
-
+<p>You could notice that if you send more than one requests withing 20
+seconds only the first request is forwarded to the actual service, and the
+rest of the requests will be served by the cache inside syanpse. You could
+observe this by looking at the priting line of the axis2 server, as well as
+by observing a constant rate as the response to the client instead of the
+random rate, which changes by each and every 20 seconds.</p>
</body>
</html>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]