title: Configure ActiveMQ broker in grails
body: <p>Using Jms plugin for grails and add dependencies for ActiveMQ worked perfect. No problems.</p>
  <p>Now I want to go beyond and perform some customization and fine tuning to make ActiveMQ behaves as I need, so I need to configure the broker instance.</p>
  <p>e.g. I want to use JDBC storage.</p>
  <p>How is possible to do that with grails and the vm embedded broker?</p>
  <p>I've actually followed the reference documentation for the JMS grails plugin ... I add jms plugin and activemq dependencies and place this on resources:</p>
  <pre><code>jmsConnectionFactory(SingleConnectionFactory) {
      targetConnectionFactory = { ActiveMQConnectionFactory cf -&gt;
          //brokerURL = 'vm://localhost'
          brokerURL = 'tcp://localhost:61616?jms.useAsyncSend=true'
      }
  }
  </code></pre>
  <p>As I've said this is fine ... but I need more tuning here, so I've tried to go adding this in the resources, so I can access the broker to fine tuning:</p>
  <pre><code>/* Establish the broker */
  amq.broker(useJmx: false, persistent: true) {
      amq.transportConnectors() {
          amq.transportConnector(uri: &quot;tcp://localhost:61616&quot;)
      }
  }
  
  amqConnectionFactory(ActiveMQConnectionFactory) {
      brokerURL = &quot;vm://localhost&quot;
  }
  
  jmsConnectionFactory(SingleConnectionFactory) {
      targetConnectionFactory = ref(amqConnectionFactory)
  }
  </code></pre>
  <p>But I start to have dependency problems like:</p>
  <pre><code>2015-03-18 13:44:14 - spring.RuntimeSpringConfigUtilities [RuntimeConfiguration] Unable to load beans from resources.groovy
  org.springframework.beans.FatalBeanException: NamespaceHandler class [org.apache.xbean.spring.context.v2.XBeanNamespaceHandler] for namespace [http://activemq.apache.org/schema/core] not found; nested exception is java.lang.ClassNotFoundException: org.apache.xbean.spring.context.v2.XBeanNamespaceHandler
  </code></pre>
  <p>So I start adding dependencies:</p>
  <pre><code>    compile 'org.apache.activemq:activemq-spring:5.7.0'
      compile 'org.springframework:spring-beans:4.1.1.RELEASE'
      compile 'org.apache.xbean:xbean-spring:4.1' 
  </code></pre>
  <p>But still have problems:</p>
  <pre><code>java.lang.NoClassDefFoundError: org/springframework/core/OrderComparator$OrderSourceProvider
  </code></pre>
  <p>At this point I get the feeling that I am doing something wrong since I see too much complexity.</p>
  <p>Is there a best way to do this?</p>