Objective: Use of both concurrency throttling and request rate based throttling.
<!-- Use of both concurrency throttling and request rate based throttling -->
<!-- the root property of the simple URL registry helps resolve a resource URL as root + key -->
<!-- all resources loaded from the URL registry would be cached for this number of milli seconds -->
<property name="text" value="**Access Accept**"/>
<sequence name="onRejectSequence" trace="enable">
<property name="text" value="**Access Denied**"/>
<reason value="**Access Denied**"/>
<property name="RESPONSE" value="true"/>
<header name="To" action="remove"/>
<throttle onReject="onRejectSequence" onAccept="onAcceptSequence" id="A">
- Deploy the SimpleStockQuoteService in sample Axis2 server and start it on port 9000.
- Start ESB with the sample configuration 372 (i.e. wso2esb-samples -sn 372).
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.
Run the client as follows:
ant stockquote -Daddurl=http://localhost:8280/services/StockQuoteProxy
You will get results same as sample 371.if you run the load test, results will be different due to affect of concurrency throttling.
Class mediator can be used to write your own custom mediation in Java and you have access to the SynapseMessageContext and to the full Synapse API in there. This is a useful extension mechanism within ESB to extend its functionality. This class can contain fields for which you can assign values at runtime through the configuration.