Camel actually started off as a sub-project of ActiveMQ - so the integration between the two is excellent (although it will be even better in ActiveMQ 6).
I blogged a while ago about the new Statistics Plugin - that you can use to request a message from the ActiveMQ broker about its running statistics (just in case you don't want to use JMX). Now it would kinda nice to automatically send these messages out from the ActiveMQ message broker periodically. Well its really easy to do that ...
Firstly enable the statics plugin in the ActiveMQ broker configuration and also import a camel config - e.g.
<broker brokerName="testBroker" xmlns="http://activemq.apache.org/schema/core">
Then in the camel XML configuration define an embedded ActiveMQ Connection -
<bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent" >
<property name="brokerURL" value="vm://testBroker?create=false&waitForStart=1000" />
<property name="userName" value="DEFAULT_VALUE"/>
<property name="password" value="DEFAULT_VALUE"/>
Note: the vm:// transport (uses a broker's name to locate it in the same JVM)
Then just add a Camel route in the Camel configuration which uses a Timer to request statistics from the broker and publish them on a Topic every second - e.g:
We are going to be on the road doing the popular Fuse days again from September - but in the meantime - you can find out more about Apache Camel, ActiveMQ and ServiceMix from our Fuse webinars.