-
Notifications
You must be signed in to change notification settings - Fork 31
Creating custom Event Generators
shmurthy62 edited this page Feb 12, 2015
·
3 revisions
When Publishing a stream we need to create customized event generators. This can be achieved by simply implementing EventBuilder.
You can learn from the InternalEventBuilder that extends EventBuilder.
<bean id="EventGenerator" class="com.ebay.jetstream.event.generator.GenericEventGenerator"
depends-on="OutboundMessages">
<property name="eventBuilder" ref="CustomEventGen"/>
<property name="rate" value="1000" />
<property name="eventCount" value="5000000000" />
<property name="genAfinityKey" value="true" />
<property name="sendEventsOnInit" value="true" />
<property name="eventSinks">
<list>
<ref bean="OutboundMessages" />
</list>
</property>
</bean>
<bean id="CustomEventGen" class="jetstreamdemo.publisher.processor.CustomEvent"></bean>
public interface EventBuilder {
String getEventStreamName();
String getPoolOfOrigin();
void initialize();
JetstreamEvent populateEvent(JetstreamEvent event);
}
public static class InternalEventBuilder implements EventBuilder {
}