Skip to content

RateLimiterProcessor

rmuthupandian edited this page Feb 11, 2015 · 1 revision

The RateLimiterProcessor is a specialized processor which provides rate limiting capability to a pipeline. It should be added as a sink to an InboundChannel. It is provisioned with a rate threshold. When the rate threshold is crossed it will use frequency estimation technique to selectively identify events associated with entities. The entities are identified by one of the fields in the event.

Specifying a RateLimiterProcessor bean

<bean id="RateLimiter" class="com.ebay.jetstream.event.processor.ratelimiter.RateLimiterProcessor">
		<property name="config" ref="RateLimiterConfig" />
		<property name="eventSinks" ref="RateLimiterSinks" />
		<property name="alertListener" ref="componentStatusHarvester" />
	</bean>

	<bean id="RateLimiterSinks" class="com.ebay.jetstream.event.EventSinkList">
		<constructor-arg>
            <list>
                 <ref bean="EsperProcessor" /> 
            </list>
        </constructor-arg>
	</bean>

	<bean id="RateLimiterConfig" class="com.ebay.jetstream.event.processor.ratelimiter.RateLimiterProcessorConfig">
		<property name="rateThreshold" value="20000" />
		<property name="rateLimit" value="true" />
                <property name="key" value="<event field to monitor" />
                <property name="itemCountThreshold" value="500" />
	</bean>

The rate of arrival of events into RateLimiterProcessor is measured. Frequency estimation is used to measure the rate of event arrival per second for events containing the field specified by key. If the count of events per second for that field exceeds "itemCountThreshold" then the event associated with that key is dropped. However if rate threshold is reached then any new events arriving will be randomly dropped to pin the rate.

Clone this wiki locally