Created
September 6, 2013 19:57
-
-
Save rajdavies/6469107 to your computer and use it in GitHub Desktop.
Use a broker camel component to re-route messages when the queue size reaches a limit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<camelContext id="camel" trace="false" xmlns="http://camel.apache.org/schema/spring"> | |
<route id="routeAboveQueueLimitTest"> | |
<from uri="broker:queue:test.broker.queue"/> | |
<choice> | |
<when> | |
<spel>#{@destinationView.queueSize >= 100}</spel> | |
<to uri="broker:queue:test.broker.processLater"/> | |
</when> | |
<otherwise> | |
<to uri="broker:queue:test.broker.queue"/> | |
</otherwise> | |
</choice> | |
</route> | |
</camelContext> | |
<bean id="brokerView" class="org.apache.activemq.broker.view.MessageBrokerView"> | |
<constructor-arg value="testBroker"/> | |
</bean> | |
<bean id="destinationView" factory-bean="brokerView" factory-method="getDestinationView"> | |
<constructor-arg value="test.broker.component.route"/> | |
</bean> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment