Hi, Yes, the throttle mediator relies on the REMOTE_ADDR property. If you just need to limit the number of messages allowed, this solution will work. The throttle mediator will see like all the messages coming from the same IP. I do not see any issue in that in your use-case.
Thanks, Vinod On Thu, Mar 15, 2018 at 7:28 PM, Júnior <[email protected]> wrote: > Hi, > > As I could see, the throttle mediator relies on the remote domain and ip > to work. > So, after adding this property before the throttle mediator, it started > working for JMS as well. > > <property name="REMOTE_ADDR" value="127.0.0.1" scope="axis2"/> > > Is it a bad practice? Is that a recommended approach? > > Thanks, > > 2018-03-14 18:36 GMT-03:00 Júnior <[email protected]>: > >> Hi, >> >> I am trying to use the Throttle mediator in a proxy that is listening to >> a JMS Queue. >> >> I would to limit the number of messages it process in a time interval. >> And the rejected ones would be stored in a messageStore to be processed >> later. >> >> When consuming the messages from queue, it seems the policy is not >> activated but when I call the proxy from SOAPUI, I see the policy working. >> >> Does this work for a jms listener? >> >> Follow my policy: >> >> <throttle id="lThrottle"> >> <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-2004 >> 01-wss-wssecurity-utility-1.0.xsd"> >> <throttle:MediatorThrottleAssertion >> xmlns:throttle="http://www.wso2.org/products/wso2commons/throttle"> >> <throttle:MaximumConcurrentAcc >> ess>2</throttle:MaximumConcurrentAccess> >> <wsp:Policy> >> <throttle:ID throttle:type="IP">other</thro >> ttle:ID> >> <wsp:Policy> >> <throttle:Control> >> <wsp:Policy> >> <throttle:MaximumCount>5</thro >> ttle:MaximumCount> >> <throttle:UnitTime>10000</thro >> ttle:UnitTime> >> <throttle:ProhibitTimePeriod >> wsp:Optional="true">2000</throttle:ProhibitTimePeriod> >> </wsp:Policy> >> </throttle:Control> >> </wsp:Policy> >> </wsp:Policy> >> </throttle:MediatorThrottleAssertion> >> </wsp:Policy> >> </policy> >> <onReject> >> <log> >> <property name="AQListener" value="** Request >> Denied from Oracle AQ - Sending to the messageStore **"/> >> </log> >> <drop/> >> </onReject> >> <onAccept> >> <log level="custom"> >> <property name="AQListener" value="** Request >> Accepted from Oracle AQ**"/> >> </log> >> <property name="FORCE_SC_ACCEPTED" scope="axis2" >> type="STRING" value="true"/> >> <property name="OUT_ONLY" scope="default" >> type="STRING" value="true"/> >> <header name="To" scope="default" value=" >> http://localhost:8280/services/ChannelAQ"/> >> <!-- <header >> expression="get-property('adc.topic.endpoint.url')" >> name="To"/>--> >> <send> >> <endpoint key="NoSuspensionEP"/> >> </send> >> </onAccept> >> </throttle> >> >> Thanks, >> -- >> Francisco Ribeiro >> *SCEA|SCJP|SCWCD|IBM Certified SOA Associate* >> > > > > -- > Francisco Ribeiro > *SCEA|SCJP|SCWCD|IBM Certified SOA Associate* > > _______________________________________________ > Dev mailing list > [email protected] > http://wso2.org/cgi-bin/mailman/listinfo/dev > > -- Vinod Kavinda Senior Software Engineer *WSO2 Inc. - lean . enterprise . middleware <http://www.wso2.com>.* Mobile : +94 (0) 712 415544 Blog : http://soatechflicks.blogspot.com/ [image: http://wso2.com/signature] <http://wso2.com/signature>
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
