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- > 200401-wss-wssecurity-utility-1.0.xsd"> > <throttle:MediatorThrottleAssertion > xmlns:throttle="http://www.wso2.org/products/wso2commons/throttle"> > <throttle:MaximumConcurrentAccess>2</throttle: > MaximumConcurrentAccess> > <wsp:Policy> > <throttle:ID throttle:type="IP">other</ > throttle:ID> > <wsp:Policy> > <throttle:Control> > <wsp:Policy> > <throttle:MaximumCount>5</ > throttle:MaximumCount> > <throttle:UnitTime>10000</ > throttle: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
