Inconsistent Responses with WSO2 Throttle Mediator

18 Views Asked by At

I've configured the system to process a maximum of 5 requests simultaneously using the "MaximumConcurrentAcces" setting. During the initial test with JMeter, sending 25 user requests at once resulted in 5 responses and 20 rejections, which is as expected. However, in subsequent tests with the same number of requests, I'm noticing inconsistencies, with sometimes 10 requests getting responses and other times 8. Can someone help me understand and address this issue? Below is the relevant portion of my source code.

wso2 Integrator Studio version : 7.1.0

<api context="/throttle" name="ThrottleMediatorAPI" xmlns="http://ws.apache.org/ns/synapse">
    <resource methods="GET">
        <inSequence>
            <throttle id="A">
                <policy>
                    <wsp:Policy wsu:id="WSO2MediatorThrottlingPolicy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
                        <throttle:MediatorThrottleAssertion xmlns:throttle="http://www.wso2.org/products/wso2commons/throttle">
                            <throttle:MaximumConcurrentAccess>5</throttle:MaximumConcurrentAccess>
                            <wsp:Policy>
                                <throttle:ID throttle:type="IP">other</throttle:ID>
                                <wsp:Policy>
                                    <throttle:Control>
                                        <wsp:Policy>
                                            <throttle:MaximumCount>20</throttle:MaximumCount>
                                            <throttle:UnitTime>2000</throttle:UnitTime>
                                            <throttle:ProhibitTimePeriod>120000</throttle:ProhibitTimePeriod>
                                        </wsp:Policy>
                                    </throttle:Control>
                                </wsp:Policy>
                            </wsp:Policy>
                        </throttle:MediatorThrottleAssertion>
                    </wsp:Policy>
                </policy>
                <onReject>
                    <log level="custom">
                        <property name="text" value="**Access Denied**"/>
                    </log>
                    <makefault version="soap11">
                        <code value="soap11Env:VersionMismatch" xmlns:soap11Env="http://schemas.xmlsoap.org/soap/envelope/"/>
                        <reason value="**Access Denied**"/>
                    </makefault>
                    <send/>
                </onReject>
                <onAccept>
                    <log level="custom">
                        <property name="text" value="**Access Accept**"/>
                    </log>
                    <send>
                        <endpoint>
                            <address uri="https://run.mocky.io/v3/f32d2430-08be-41a8-94fe-31017a8375d8">
                            </address>
                        </endpoint>
                    </send>
                </onAccept>
            </throttle>
        </inSequence>
        <outSequence>
            <throttle id="A">
                <onReject/>
                <onAccept/>
            </throttle>
            <send/>
        </outSequence>
        <faultSequence/>
    </resource>
</api>
0

There are 0 best solutions below