Objective: Use of both concurrency throttling and request rate based throttling.
- 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).
NoteIn order to run this sample, you need to manually replace the content in
<ESB_HOME>/repository/samples/synapse_sample_372.xmlwith the XML configuration given above.This needs to be done due to a known issue in the configuration file
<ESB_HOME>/repository/samples/synapse_sample_372.xml, which will be fixed in version 4.9.0.
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:
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.