title: How to check ActiveMQ queues in unit test using JUnit Rule with EmbeddedActiveMQBroker
body: <p>I created an Integration test (based on apache camel and blueprint) that sends some messages to an ActiveMQ service on my machine.
  Via the admin-web interface i can check if my messages arrived. To decouple from a locally running ActiveMQ i am now using the EmbeddedActiveMQBroker with JUnit Rule (followed instructions from <a href="http://activemq.apache.org/how-to-unit-test-jms-code.html" rel="nofollow noreferrer">here</a>):</p>
  
  <pre><code>@Rule
  public EmbeddedActiveMQBroker broker = new EmbeddedActiveMQBroker() {
      @Override
      protected void configure() {
          try {
              this.getBrokerService().addConnector("tcp://localhost:61616");
  
          } catch (Exception e) {
              // noop test should fail
          }
      }
  };
  </code></pre>
  
  <p>The test works fine as before.
  But: Is there a way to check the number of (queued)messeages for a given queue? The test sends messages to the queue "q".</p>