Re: ActiveMQ creates a broker on demand if one isnt running already
When the VM transport is used to connect to ActiveMQ, the first to connect will start up an embedded ActiveMQ broker. All following connections within the same JVM will connect to this embedded broker. If you booted ActiveMQ up in a separate process and ran the example, it is likely that a 2nd ActiveMQ broker was created in the VM (so you didn't actually connect to the one you started manually).
If you want to connect to the broker to see queue stats, I would recommend starting up ActiveMQ manually like you did initially and connect to it using the TCP transport like so
<bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
<property name="connectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="tcp://localhost:61616" />
</bean>
</property>
</bean>
Then you can look at the JMS queue contents using jconsole or the ActiveQM web console http://activemq.apache.org/web-console.html
Cheers,
Jon
|