...
Table of Contents |
---|
Component for throttling functionality.
...
Throttling component counts input requests from specified source (external) system and for specific operation. If this count exceeds defined limit in defined time interval then CleverBus OpenHub will start to reject new input requests (only requests from specified source system and for specified operation) - exception is thrown.
...
- throttling.defaultInterval: default time interval in seconds. Default value is 60s.
- throttling.defaultLimit: default max. count of requests for specified time interval. Default value is 60.
- throttling.sourceSystem.operationName, where
- sourceSystem identifies source (callee) system. Can be used specific system names (defined with org.openhubframework.cleverbusopenhub.api.entity.ExternalSystemExtEnum) or use asterix (*) that represents any source system. Then only requests with specific operations are checked.
- operationName identifies operation. Can be also used asterix (*) that represents any operation. Then only requests from source systems are checked.
Parameter throttling.sourceSystem.operationName has the format limit [/interval]:
...
Throttling parameters is allowed to configured via JMX, for example with jconsole tool:
URI format
Code Block |
---|
throttling:requestType[:operationName] |
...
Throttling component needs reference to org.cleverbusopenhubframework.openhub.spi.throttling.ThrottlingProcessor that needs (in default implementation) reference to org.openhubframework.cleverbusopenhub.spi.throttling.ThrottlingConfiguration and org.openhubframework.cleverbusopenhub.spi.throttling.ThrottleCounter.
...
Code Block |
---|
<bean id="throttlingConfiguration" class="org.openhubframework.cleverbusopenhub.core.throttling.ThrottlingPropertiesConfiguration"> <constructor-arg ref="confProperties"/> <property name="throttlingDisabled" value="${disable.throttling}"/> </bean> <bean class="org.cleverbusopenhubframework.openhub.core.throttling.ThrottleCounterMemoryImpl" /> <bean class="org.cleverbusopenhubframework.openhub.core.throttling.ThrottleProcessorImpl" /> |
...
Code Block |
---|
<bean id="confProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean"> <property name="ignoreResourceNotFound" value="true"/> <property name="locations"> <list> <value>classpath:applicationCore.cfg</value> ... <value>classpath:throttlingCore.cfg</value> <value>classpath:throttling.cfg</value> <value>classpath:throttling0.cfg</value> </list> </property> </bean> |
Examples
Code Block |
---|
throttling:sync:sendSms throttling:async |
...