This documentation is for WSO2 Enterprise Service Bus version 4.8.1 . View documentation for the latest release.

All docs This doc
Skip to end of metadata
Go to start of metadata

The Throttle Mediator can be used for rate-limiting as well as concurrency-based limiting. A WS-Policy dictates the throttling configuration and may be specified inline or loaded from the registry. The Throttle Mediator could be added in the request path for rate limiting and concurrent access limitation. When using for concurrent access limitation, the same Throttle Mediator id must be triggered on the response flow so that completed responses are deducted from the available limit. (i.e. two instances of the throttle mediator with the same id attribute in the request and response flows). The onReject and onAccept sequence references or inline sequences define how accepted and rejected messages are to be handled.

The Throttle mediator carries out throttling for a proxy service at the stage where requests are being mediated. If you want the throttling to be carried out before mediation, define a throttle policy at service level.



<throttle [onReject="string"] [onAccept="string"] id="string">
    (<policy key="string"/> | <policy>..</policy>)

UI Configuration

Throttle Mediator Options:

  • Throttle Group ID - The id for the throttle group.


    You would have to throttle mediator configuration in request and response paths with the same group id.

  • Throttle Referring Policy - The policy for the throttling. You can specify it inline or refer from Configuration Registry or Governance Registry.
  • On Acceptance Referring Sequence - The sequence to act on acceptance. You can specify it inline or refer from Configuration Registry or Governance Registry.
  • On Rejection Referring Sequence - The sequence to act on rejection. You can specify it inline or refer from Configuration Registry or Governance Registry.

For more information on the registry, see Working with the Registry.


You can configure the Mediator using XML. Click on "switch to source view" in the "Mediator" window.


    <throttle id="A">
            <!-- define throttle policy -->
            <wsp:Policy xmlns:wsp=""
            <log level="custom">
                <property name="text" value="**Access Accept**"/>
                    <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
            <log level="custom">
                <property name="text" value="**Access Denied**"/>
                <code value="tns:Receiver"
                <reason value="**Access Denied**"/>
            <property name="RESPONSE" value="true"/>
            <header name="To" action="remove"/>

The above example specifies the Throttle Mediator inside the In Mediator. Therefore, all request messages directed to the main sequence will be subjected to throttling. The Throttle Mediator has policy, onAccept and onReject tags at top level. The policy tag specifies the throttling policy for throttling messages. This sample policy only contains a component called MaximumConcurrentAccess. This indicates the maximum number of concurrent requests that can pass through Synapse on a single unit of time.

  • No labels