You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@synapse.apache.org by Olivier Ziller <ol...@gmail.com> on 2008/06/06 22:09:04 UTC

can't get simple throttle to work

hello,

i'm trying to use the throttle mediator for a simple use : restrict the 
use of a proxy to a particular ip address

here is my configuration :

    <syn:proxy name="InfosEtuMetier2" transports="https http" 
startOnLoad="true" statistics="enable" trace="enable">
        <syn:target outSequence="main">
            <syn:inSequence>
                <syn:throttle trace="enable" id="OZ">
                    <syn: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:ID 
throttle:type="IP">193.54.39.29</throttle:ID>
                            </throttle:ThrottleAssertion>
                        </wsp:Policy>
                    </syn:policy>
                    <syn:onReject>
                        <syn:sequence key="reject"/>
                    </syn:onReject>
                    <syn:onAccept>
                        <syn:send>
                            <syn:endpoint key="InfosEtuMetier"/>
                        </syn:send>
                    </syn:onAccept>
                </syn:throttle>
            </syn:inSequence>
        </syn:target>
    </syn:proxy>

but it fails with this error :

21:59:30,594 [193.54.39.95-spdev2.univ-nancy2.fr] [HttpServerWorker-18] 
INFO Start : Throttle mediator

21:59:30,595 [193.54.39.95-spdev2.univ-nancy2.fr] [HttpServerWorker-18] 
TRACE Message : <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soapenv:Body><recupererSitFamWS 
xmlns="gouv.education.apogee.commun.servicesmetiers.InfosEtuMetier_01062007"><_code 
xsi:nil="true" /><_temoinEnService xsi:nil="true" /><_temoinAD 
xsi:nil="true" /></recupererSitFamWS></soapenv:Body></soapenv:Envelope>

21:59:30,595 [193.54.39.95-spdev2.univ-nancy2.fr] [HttpServerWorker-18] 
TRACE Initializing using static throttling 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:ID 
throttle:Type="IP">193.54.39.29</throttle:ID> 
</throttle:ThrottleAssertion> </wsp:Policy>

21:59:30,597 [193.54.39.95-spdev2.univ-nancy2.fr] [HttpServerWorker-18] 
ERROR Error processing the throttling policy

21:59:30,597 [193.54.39.95-spdev2.univ-nancy2.fr] [HttpServerWorker-18] 
WARN Executing fault handler due to exception encountered

21:59:30,598 [193.54.39.95-spdev2.univ-nancy2.fr] [HttpServerWorker-18] 
WARN Fault handler - setting ERROR_MESSAGE : Error processing the 
throttling policy

21:59:30,598 [193.54.39.95-spdev2.univ-nancy2.fr] [HttpServerWorker-18] 
WARN Fault handler - setting ERROR_DETAIL : 
org.apache.synapse.SynapseException: Error processing the throttling 
policy at 
org.apache.synapse.mediators.AbstractMediator.handleException(AbstractMediator.java:220) 
at 
org.apache.synapse.mediators.throttle.ThrottleMediator.mediate(ThrottleMediator.java:145) 
at 
org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:60) 
at 
org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:125) 
at 
org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:140) 
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:145) at 
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275) 
at 
org.apache.synapse.transport.nhttp.ServerWorker.processPost(ServerWorker.java:226) 
at 
org.apache.synapse.transport.nhttp.ServerWorker.run(ServerWorker.java:190) 
at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650) 
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675) 
at java.lang.Thread.run(Thread.java:595) Caused by: 
org.wso2.throttle.ThrottleException: Error was ocuured during throttle 
policy processing Invalied Throttle Policy configuration at 
org.wso2.throttle.ThrottlePolicyProcessor.handleException(ThrottlePolicyProcessor.java:385) 
at 
org.wso2.throttle.ThrottlePolicyProcessor.processPolicy(ThrottlePolicyProcessor.java:366) 
at 
org.apache.synapse.mediators.throttle.ThrottleMediator.mediate(ThrottleMediator.java:129) 
... 10 more

21:59:30,599 [193.54.39.95-spdev2.univ-nancy2.fr] [HttpServerWorker-18] 
WARN Fault handler - setting ERROR_EXCEPTION : 
org.apache.synapse.SynapseException: Error processing the throttling policy

any idea?

best regards

Re: can't get simple throttle to work

Posted by "Asankha C. Perera" <as...@wso2.com>.
Olivier
> i'm using wso2 esb wich is shipped with synapse 1.1.1
> as you i think that my polycy is not well defined but i can't find a 
> document on how to use it for this simple case of use.
Indika will be able to help you with the correct policy by Monday

asankha

Re: can't get simple throttle to work

Posted by Olivier Ziller <ol...@gmail.com>.
hello,

i'm using wso2 esb wich is shipped with synapse 1.1.1
as you i think that my polycy is not well defined but i can't find a 
document on how to use it for this simple case of use.

regards

Ruwan Linton a écrit :
> I think something wrong with the throttle policy, what is the version of
> Synapse that you are trying to use?
>
> Thanks,
> Ruwan
>
> On Sat, Jun 7, 2008 at 1:39 AM, Olivier Ziller <
> olivier.ziller.lists@gmail.com> wrote:
>   
>

Re: can't get simple throttle to work

Posted by Ruwan Linton <ru...@gmail.com>.
I think something wrong with the throttle policy, what is the version of
Synapse that you are trying to use?

Thanks,
Ruwan

On Sat, Jun 7, 2008 at 1:39 AM, Olivier Ziller <
olivier.ziller.lists@gmail.com> wrote:

> hello,
>
> i'm trying to use the throttle mediator for a simple use : restrict the use
> of a proxy to a particular ip address
>
> here is my configuration :
>
>   <syn:proxy name="InfosEtuMetier2" transports="https http"
> startOnLoad="true" statistics="enable" trace="enable">
>       <syn:target outSequence="main">
>           <syn:inSequence>
>               <syn:throttle trace="enable" id="OZ">
>                   <syn: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:ID throttle:type="IP">193.54.39.29
> </throttle:ID>
>                           </throttle:ThrottleAssertion>
>                       </wsp:Policy>
>                   </syn:policy>
>                   <syn:onReject>
>                       <syn:sequence key="reject"/>
>                   </syn:onReject>
>                   <syn:onAccept>
>                       <syn:send>
>                           <syn:endpoint key="InfosEtuMetier"/>
>                       </syn:send>
>                   </syn:onAccept>
>               </syn:throttle>
>           </syn:inSequence>
>       </syn:target>
>   </syn:proxy>
>
> but it fails with this error :
>
> 21:59:30,594 [193.54.39.95-spdev2.univ-nancy2.fr] [HttpServerWorker-18]
> INFO Start : Throttle mediator
>
> 21:59:30,595 [193.54.39.95-spdev2.univ-nancy2.fr] [HttpServerWorker-18]
> TRACE Message : <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="
> http://www.w3.org/2001/XMLSchema"><soapenv:Body><recupererSitFamWS
> xmlns="gouv.education.apogee.commun.servicesmetiers.InfosEtuMetier_01062007"><_code
> xsi:nil="true" /><_temoinEnService xsi:nil="true" /><_temoinAD
> xsi:nil="true" /></recupererSitFamWS></soapenv:Body></soapenv:Envelope>
>
> 21:59:30,595 [193.54.39.95-spdev2.univ-nancy2.fr] [HttpServerWorker-18]
> TRACE Initializing using static throttling 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:ID throttle:Type="IP">193.54.39.29</throttle:ID>
> </throttle:ThrottleAssertion> </wsp:Policy>
>
> 21:59:30,597 [193.54.39.95-spdev2.univ-nancy2.fr] [HttpServerWorker-18]
> ERROR Error processing the throttling policy
>
> 21:59:30,597 [193.54.39.95-spdev2.univ-nancy2.fr] [HttpServerWorker-18]
> WARN Executing fault handler due to exception encountered
>
> 21:59:30,598 [193.54.39.95-spdev2.univ-nancy2.fr] [HttpServerWorker-18]
> WARN Fault handler - setting ERROR_MESSAGE : Error processing the throttling
> policy
>
> 21:59:30,598 [193.54.39.95-spdev2.univ-nancy2.fr] [HttpServerWorker-18]
> WARN Fault handler - setting ERROR_DETAIL :
> org.apache.synapse.SynapseException: Error processing the throttling policy
> at
> org.apache.synapse.mediators.AbstractMediator.handleException(AbstractMediator.java:220)
> at
> org.apache.synapse.mediators.throttle.ThrottleMediator.mediate(ThrottleMediator.java:145)
> at
> org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:60)
> at
> org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:125)
> at
> org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:140)
> at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:145) at
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
> at
> org.apache.synapse.transport.nhttp.ServerWorker.processPost(ServerWorker.java:226)
> at
> org.apache.synapse.transport.nhttp.ServerWorker.run(ServerWorker.java:190)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
> at java.lang.Thread.run(Thread.java:595) Caused by:
> org.wso2.throttle.ThrottleException: Error was ocuured during throttle
> policy processing Invalied Throttle Policy configuration at
> org.wso2.throttle.ThrottlePolicyProcessor.handleException(ThrottlePolicyProcessor.java:385)
> at
> org.wso2.throttle.ThrottlePolicyProcessor.processPolicy(ThrottlePolicyProcessor.java:366)
> at
> org.apache.synapse.mediators.throttle.ThrottleMediator.mediate(ThrottleMediator.java:129)
> ... 10 more
>
> 21:59:30,599 [193.54.39.95-spdev2.univ-nancy2.fr] [HttpServerWorker-18]
> WARN Fault handler - setting ERROR_EXCEPTION :
> org.apache.synapse.SynapseException: Error processing the throttling policy
>
> any idea?
>
> best regards
>



-- 
Ruwan Linton
http://www.wso2.org - "Oxygenating the Web Services Platform"

Re: can't get simple throttle to work

Posted by indika kumara <in...@gmail.com>.
HI Hi Oliver

Currently , you cannot set a list of distinct IP address. You have to put a
throttle:ID element per IP(Actual wsp:All elements ). In the future , I will
add a list of distinct IP address support for a single throttle:ID element.

Thanks

Indika

Re: can't get simple throttle to work

Posted by Olivier Ziller <ol...@gmail.com>.
Hi Indika,

thank you, it's a great response!
my throttle configuration works now but i've a last question : is it 
possible, in the throttle:ID element, to have a list of distinct IP 
address (not a range) or do i have to put a throttle:ID element per IP?

<throttle:ID throttle:type="IP|DOMAIN">(IP or Domain)</throttle:ID>

best regards

indika kumara a écrit :
> Hi Oliver
>
>  Basically throttle can be configured to achieve two things.
>
>    1.
>
>    Throttling concurrent access to the system
>
>    In this case, throttle mediator limits the number of virtual concurrent
>    connection   to the given number from throttle mediator to the external.
>
>    Example 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>
>
>                         </throttle:ThrottleAssertion>
>                     </wsp:Policy>
>
> In this case, maximum number of concurrent access it 10. Therefore, even
> there are more than 10 concurrent incoming messages to the throttle mediator
> ,the out going messages from that throttle mediator always constant and in
> this case , it is 10.Therefore , only 10 concurrent connection are virtually
> enable. Please refers to the sample 370.(synapse_sample_370.xml).
>
> Note : when you are defined a throttle with concurrency policy, there should
> be on out path a another throttle that has same id('id' attribute of
> throttle mediator ) in oder to create a throttle group. The throttle
> mediator in the out path is used to free a virtual connection so that any
> incoming request can use. Please refers to the sample
> 370.(synapse_sample_370.xml).
>
>      2. Rate based access throttling.
>
>    1.
>
>    There are two sub category. One is client 'IP' based and second other is
>    client 'domain'(host) name based. The general policy format is as follows.
>
>           <wsp:Policy xmlns:wsp="
> http://schemas.xmlsoap.org/ws/2004/09/policy"
>             xmlns:throttle="
> http://www.wso2.org/products/wso2commons/throttle">
>     <throttle:ThrottleAssertion>
>         <wsp:All>
>             <throttle:ID throttle:type="IP">other</throttle:ID>
>             <wsp:ExactlyOne>
>                 <wsp:All>
>                     <throttle:MaximumCount>4</throttle:MaximumCount>
>                     <throttle:UnitTime>800000</throttle:UnitTime>
>                     <throttle:ProhibitTimePeriod wsp:Optional="true">10000
>                     </throttle:ProhibitTimePeriod>
>                 </wsp:All>
>                 <throttle:IsAllow>true</throttle:IsAllow>
>             </wsp:ExactlyOne>
>         </wsp:All>
>         <wsp:All>
>             <throttle:ID
> throttle:type="IP">192.168.8.200-192.168.8.222</throttle:ID>
>             <wsp:ExactlyOne>
>                 <wsp:All>
>                     <throttle:MaximumCount>8</throttle:MaximumCount>
>                     <throttle:UnitTime>800000</throttle:UnitTime>
>                     <throttle:ProhibitTimePeriod wsp:Optional="true">10
>                     </throttle:ProhibitTimePeriod>
>                 </wsp:All>
>                 <throttle:IsAllow>true</throttle:IsAllow>
>             </wsp:ExactlyOne>
>         </wsp:All>
>     </throttle:ThrottleAssertion>
> </wsp:Policy>
>
> For a valid throttle policy , there should be a one or more children (web
> service policy type All assertion - All) to a ThrottleAssertion
>
> All policy assertion (web service policy type All assertion – All) has the
> following format
>
>   <wsp:All>
>             <throttle:ID throttle:type="IP|DOMAIN">(IP or Domain
> )</throttle:ID>
>             <wsp:ExactlyOne>
>                 <wsp:All>
>                     <throttle:MaximumCount>number -
> int</throttle:MaximumCount>
>                     <throttle:UnitTime>Time window in millisecond
> </throttle:UnitTime>
>                     <throttle:ProhibitTimePeriod
> wsp:Optional="true">millisecond
>                     </throttle:ProhibitTimePeriod>
>                 </wsp:All>
>                 <throttle:IsAllow>true|false</throttle:IsAllow>
>             </wsp:ExactlyOne>
>         </wsp:All>
>
> The web service policy XML Primitive assertion ID ( <throttle:ID
> throttle:type="IP|DOMAIN">) contains type attribute which is required and
> only allow to contains IP or DOMAIN. This attribute differentiates the
> throttle type.
>
> With in this assrtion , there should be a valid web service policy ExactlyOne
> assertions. To valid this assertion it should contains either
>
>
>  1) <throttle:IsAllow>true|false</throttle:IsAllow>
>
> Or
>
> 2)  <wsp:All>
>                     <throttle:MaximumCount>number -
> int</throttle:MaximumCount>
>                     <throttle:UnitTime>Time window in millisecond
> </throttle:UnitTime>
>                     <throttle:ProhibitTimePeriod
> wsp:Optional="true">millisecond
>                     </throttle:ProhibitTimePeriod>
>      </wsp:All>
>
>  In the case of both are present, the order in which they are present make
> the priority. (first one get priority).
>
> IsAllow – This assertion indicates that the given IP or Domain are fully
> allowed( in the case of value is 'true') or are fully denied. This is used
> in order to avoid any computation when just some one has to be denied or
> allowed.
>
> Second one (WS All assertion ) is used to control the access. The means of
> attributes are as follows.
>
> MaximumCount – Maximum number of access for a given peroid of time (Time
> window). (required attribute)
>
> UnitTime _ The time window that 'MaximumCount' is applicable.(Required
> attribute)
>
> ProhibitTimePeriod – If the 'MaximumCount' has been gone before , 'UnitTime'
> is over. Then implicitly access is prohibited for time period (UnitTime –
> the time that notify 'MaximumCount' has been gone.).If some one want to
> override this default behavior , the 'ProhibitTimePeriod' has to be given
> expilitily. This is a optional attribute.
>
>
>  Note : The value for IP can be single or range.
>
> The value of domain can be single(c.a.com) or multiple (*.a.com)
>
> There is a special value , called 'other'. This indicates all the IPs or
> domains excluding explicitly defined values in the policy.
>
> Please refers to the sample 371 (synapse_sample_371.xml)
>
>
> In your configuration, policy  has to changed either
>
> 1) If you want to control access
>
> <wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
>             xmlns:throttle="
> http://www.wso2.org/products/wso2commons/throttle">
>     <throttle:ThrottleAssertion>
>         *<wsp:All>*
>         *    <throttle:ID throttle:type="IP">193.54.39.29</throttle:ID>
>             <wsp:ExactlyOne>
>                 <wsp:All>
>                     <throttle:MaximumCount>number -
> int</throttle:MaximumCount>
>                     <throttle:UnitTime>Time window in
> millisecond</throttle:UnitTime>
>                     <throttle:ProhibitTimePeriod
> wsp:Optional="true">millisecond
>                     </throttle:ProhibitTimePeriod>
>                 </wsp:All>
>             </wsp:ExactlyOne>
>         </wsp:All>*
>     </throttle:ThrottleAssertion>
> </wsp:Policy>
>
> 2) If you want to full allow or deny
>
> <wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
>             xmlns:throttle="
> http://www.wso2.org/products/wso2commons/throttle">
> <throttle:ThrottleAssertion>
>    * <wsp:All>
>         <throttle:ID throttle:type="IP">193.54.39.29</throttle:ID>
>         <wsp:ExactlyOne>
>             <throttle:IsAllow>true|false</throttle:IsAllow>
>         </wsp:ExactlyOne>
>     </wsp:All>*
> </throttle:ThrottleAssertion>
> </wsp:Policy>
>
>
> Please refers to sample (370,371)
>
>
> Thanks
>
> Indika
>
>   

Re: can't get simple throttle to work

Posted by indika kumara <in...@gmail.com>.
Hi Oliver

 Basically throttle can be configured to achieve two things.

   1.

   Throttling concurrent access to the system

   In this case, throttle mediator limits the number of virtual concurrent
   connection   to the given number from throttle mediator to the external.

   Example 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>

                        </throttle:ThrottleAssertion>
                    </wsp:Policy>

In this case, maximum number of concurrent access it 10. Therefore, even
there are more than 10 concurrent incoming messages to the throttle mediator
,the out going messages from that throttle mediator always constant and in
this case , it is 10.Therefore , only 10 concurrent connection are virtually
enable. Please refers to the sample 370.(synapse_sample_370.xml).

Note : when you are defined a throttle with concurrency policy, there should
be on out path a another throttle that has same id('id' attribute of
throttle mediator ) in oder to create a throttle group. The throttle
mediator in the out path is used to free a virtual connection so that any
incoming request can use. Please refers to the sample
370.(synapse_sample_370.xml).

     2. Rate based access throttling.

   1.

   There are two sub category. One is client 'IP' based and second other is
   client 'domain'(host) name based. The general policy format is as follows.

          <wsp:Policy xmlns:wsp="
http://schemas.xmlsoap.org/ws/2004/09/policy"
            xmlns:throttle="
http://www.wso2.org/products/wso2commons/throttle">
    <throttle:ThrottleAssertion>
        <wsp:All>
            <throttle:ID throttle:type="IP">other</throttle:ID>
            <wsp:ExactlyOne>
                <wsp:All>
                    <throttle:MaximumCount>4</throttle:MaximumCount>
                    <throttle:UnitTime>800000</throttle:UnitTime>
                    <throttle:ProhibitTimePeriod wsp:Optional="true">10000
                    </throttle:ProhibitTimePeriod>
                </wsp:All>
                <throttle:IsAllow>true</throttle:IsAllow>
            </wsp:ExactlyOne>
        </wsp:All>
        <wsp:All>
            <throttle:ID
throttle:type="IP">192.168.8.200-192.168.8.222</throttle:ID>
            <wsp:ExactlyOne>
                <wsp:All>
                    <throttle:MaximumCount>8</throttle:MaximumCount>
                    <throttle:UnitTime>800000</throttle:UnitTime>
                    <throttle:ProhibitTimePeriod wsp:Optional="true">10
                    </throttle:ProhibitTimePeriod>
                </wsp:All>
                <throttle:IsAllow>true</throttle:IsAllow>
            </wsp:ExactlyOne>
        </wsp:All>
    </throttle:ThrottleAssertion>
</wsp:Policy>

For a valid throttle policy , there should be a one or more children (web
service policy type All assertion - All) to a ThrottleAssertion

All policy assertion (web service policy type All assertion – All) has the
following format

  <wsp:All>
            <throttle:ID throttle:type="IP|DOMAIN">(IP or Domain
)</throttle:ID>
            <wsp:ExactlyOne>
                <wsp:All>
                    <throttle:MaximumCount>number -
int</throttle:MaximumCount>
                    <throttle:UnitTime>Time window in millisecond
</throttle:UnitTime>
                    <throttle:ProhibitTimePeriod
wsp:Optional="true">millisecond
                    </throttle:ProhibitTimePeriod>
                </wsp:All>
                <throttle:IsAllow>true|false</throttle:IsAllow>
            </wsp:ExactlyOne>
        </wsp:All>

The web service policy XML Primitive assertion ID ( <throttle:ID
throttle:type="IP|DOMAIN">) contains type attribute which is required and
only allow to contains IP or DOMAIN. This attribute differentiates the
throttle type.

With in this assrtion , there should be a valid web service policy ExactlyOne
assertions. To valid this assertion it should contains either


 1) <throttle:IsAllow>true|false</throttle:IsAllow>

Or

2)  <wsp:All>
                    <throttle:MaximumCount>number -
int</throttle:MaximumCount>
                    <throttle:UnitTime>Time window in millisecond
</throttle:UnitTime>
                    <throttle:ProhibitTimePeriod
wsp:Optional="true">millisecond
                    </throttle:ProhibitTimePeriod>
     </wsp:All>

 In the case of both are present, the order in which they are present make
the priority. (first one get priority).

IsAllow – This assertion indicates that the given IP or Domain are fully
allowed( in the case of value is 'true') or are fully denied. This is used
in order to avoid any computation when just some one has to be denied or
allowed.

Second one (WS All assertion ) is used to control the access. The means of
attributes are as follows.

MaximumCount – Maximum number of access for a given peroid of time (Time
window). (required attribute)

UnitTime _ The time window that 'MaximumCount' is applicable.(Required
attribute)

ProhibitTimePeriod – If the 'MaximumCount' has been gone before , 'UnitTime'
is over. Then implicitly access is prohibited for time period (UnitTime –
the time that notify 'MaximumCount' has been gone.).If some one want to
override this default behavior , the 'ProhibitTimePeriod' has to be given
expilitily. This is a optional attribute.


 Note : The value for IP can be single or range.

The value of domain can be single(c.a.com) or multiple (*.a.com)

There is a special value , called 'other'. This indicates all the IPs or
domains excluding explicitly defined values in the policy.

Please refers to the sample 371 (synapse_sample_371.xml)


In your configuration, policy  has to changed either

1) If you want to control access

<wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
            xmlns:throttle="
http://www.wso2.org/products/wso2commons/throttle">
    <throttle:ThrottleAssertion>
        *<wsp:All>*
        *    <throttle:ID throttle:type="IP">193.54.39.29</throttle:ID>
            <wsp:ExactlyOne>
                <wsp:All>
                    <throttle:MaximumCount>number -
int</throttle:MaximumCount>
                    <throttle:UnitTime>Time window in
millisecond</throttle:UnitTime>
                    <throttle:ProhibitTimePeriod
wsp:Optional="true">millisecond
                    </throttle:ProhibitTimePeriod>
                </wsp:All>
            </wsp:ExactlyOne>
        </wsp:All>*
    </throttle:ThrottleAssertion>
</wsp:Policy>

2) If you want to full allow or deny

<wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
            xmlns:throttle="
http://www.wso2.org/products/wso2commons/throttle">
<throttle:ThrottleAssertion>
   * <wsp:All>
        <throttle:ID throttle:type="IP">193.54.39.29</throttle:ID>
        <wsp:ExactlyOne>
            <throttle:IsAllow>true|false</throttle:IsAllow>
        </wsp:ExactlyOne>
    </wsp:All>*
</throttle:ThrottleAssertion>
</wsp:Policy>


Please refers to sample (370,371)


Thanks

Indika