Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
121 lines (107 sloc) 3.95 KB
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<bean id="eventCatcher" class="org.apache.s4.example.speech01.SentenceReceiverPE">
<property name="keys">
<list>
<value>SentenceJoined *</value>
</list>
</property>
</bean>
<bean id="rerouteSentencePE" class="org.apache.s4.processor.ReroutePE">
<property name="id" value="rerouteSentencePE"/>
<property name="dispatcher" ref="forkdispatcher"/>
<property name="keys">
<list>
<value>RawSentence *</value>
</list>
</property>
<property name="outputStreamName" value="Sentence"/>
</bean>
<bean id="rerouteSpeechPE" class="org.apache.s4.processor.ReroutePE">
<property name="id" value="rerouteSpeechPE"/>
<property name="dispatcher" ref="forkdispatcher"/>
<property name="keys">
<list>
<value>RawSpeech *</value>
</list>
</property>
<property name="outputStreamName" value="Speech"/>
</bean>
<bean id="sentenceJoinPE" class="org.apache.s4.processor.JoinPE">
<property name="id" value="sentenceJoinPE"/>
<property name="keys">
<list>
<value>Sentence speechId</value>
<value>Speech id</value>
</list>
</property>
<property name="includeFields">
<list>
<value>Sentence *</value>
<value>Speech location</value>
</list>
</property>
<property name="outputStreamName" value="SentenceJoined"/>
<property name="outputClassName" value="org.apache.s4.example.speech01.Sentence"/>
<property name="dispatcher" ref="forkdispatcher"/>
<property name="ttl" value="600"/> <!-- join related events that arrive no more than 10 minutes apart -->
</bean>
<bean id="sentenceSpeechIdPartitioner" class="org.apache.s4.dispatcher.partitioner.DefaultPartitioner">
<property name="streamNames">
<list>
<value>Sentence</value>
<value>SentenceJoined</value>
</list>
</property>
<property name="hashKey">
<list>
<value>speechId</value>
</list>
</property>
<property name="hasher" ref="hasher"/>
<property name="debug" value="false"/>
</bean>
<bean id="speechIdPartitioner" class="org.apache.s4.dispatcher.partitioner.DefaultPartitioner">
<property name="streamNames">
<list>
<value>Speech</value>
</list>
</property>
<property name="hashKey">
<list>
<value>id</value>
</list>
</property>
<property name="hasher" ref="hasher"/>
<property name="debug" value="false"/>
</bean>
<bean id="dispatcher" class="org.apache.s4.dispatcher.Dispatcher" init-method="init">
<property name="partitioners">
<list>
<ref bean="sentenceSpeechIdPartitioner"/>
<ref bean="speechIdPartitioner"/>
</list>
</property>
<property name="eventEmitter" ref="commLayerEmitter"/>
<property name="loggerName" value="s4"/>
</bean>
<!-- dispatcher to S4 and client adapter -->
<bean id="forkdispatcher" class="org.apache.s4.dispatcher.MultiDispatcher">
<property name="dispatchers">
<list>
<!-- send everything through the S4 dispatcher -->
<ref bean="dispatcher"/>
<!-- send some streams to client adapters -->
<bean id="selectiveDispatchToAdapter" class="org.apache.s4.dispatcher.StreamSelectingDispatcher">
<property name="dispatcher" ref="dispatcherToClientAdapters"/>
<property name="streams">
<list>
<value>SentenceJoined</value>
<value>Sentence</value>
</list>
</property>
</bean>
</list>
</property>
</bean>
</beans>
Something went wrong with that request. Please try again.