Skip to content

Instantly share code, notes, and snippets.

@codebrane
Created July 25, 2012 12:40
Show Gist options
  • Save codebrane/3175958 to your computer and use it in GitHub Desktop.
Save codebrane/3175958 to your computer and use it in GitHub Desktop.
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<camelContext xmlns="http://camel.apache.org/schema/spring"
id="matrixRouter"
trace="true">
<route id="blackboard">
<from uri="activemq:topic:blackboarderror"/>
<transacted />
<filter>
<simple>${header.retryCount} == null</simple>
<setHeader headerName="retryCount">
<simple>0</simple>
</setHeader>
</filter>
<choice>
<when>
<simple>${header.retryCount} > 10</simple>
<process ref="imcProcessor" />
<to uri="activemq:topic:blackboardimc"/>
</when>
<otherwise>
<delay><constant>1000</constant></delay>
<setHeader headerName="retryCount">
<simple>${header.retryCount}++</simple>
</setHeader>
<to uri="activemq:topic:blackboard"/>
</otherwise>
</choice>
</route>
</camelContext>
<bean id="jmsTransactionManager" class="org.springframework.jms.connection.JmsTransactionManager">
<property name="connectionFactory" ref="jmsConnectionFactory" />
</bean>
<bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="vm://matrixBroker?create=false"/>
</bean>
<!-- <bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent">
<property name="transacted" value="true"/>
<property name="transactionManager" ref="txManager"/>
</bean>
<bean id="txManager" class="org.springframework.jms.connection.JmsTransactionManager">
<property name="connectionFactory" ref="jmsConnectionFactory"/>
</bean>
<bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="tcp://matrixBroker?create=false"/>
</bean> -->
<bean id="imcProcessor" class="uk.ac.uhi.it.matrix.processor.IMCProcessor" scope="prototype" init-method="init">
<property name="rootPeristenceDir" value="/Users/alistair/apps/dev/matrix/persistence"/>
<property name="matrixErrorDescriptionHeader" value="matrix_ErrorDescription"/>
<property name="matrixUseridHeader" value="matrix_Userid"/>
<property name="matrixModeHeader" value="matrix_Mode"/>
</bean>
<bean id="bb8Hack" class="uk.ac.uhi.it.matrix.processor.BB8HackProcessor" scope="prototype">
<property name="snapshotDir" value="/Users/alistair/apps/dev/matrix/snapshot"/>
</bean>
</beans>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment