activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davidnewcomb <>
Subject Got Java class need XML - embedding a broker in spring
Date Wed, 13 Feb 2008 17:55:52 GMT

Sorry I messed up the title on a previous post. Anyway...

Try as I might I just can not get the xml configuration to start an embedded
activemq broker.
Please can someone help turn my hack into a couple of short lines of xml.
I'm using ActiveMQ 5.0.0, Spring 2.5, JDK 1.6, Apache Tomcat/6.0.14

In the war\WEB-INF\sitemanager-servlet.xml

<bean id="broker" class="com.mycompany.sitemanager.QBroker"/>

The code for QBroker is:

package com.mycompany.sitemanager;



import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class QBroker
  protected final Log logger = LogFactory.getLog(getClass());
  private static String brokerUrl = "broker:tcp://localhost:61616" ;
  QBroker() throws Exception
    { ("Broker Setup") ;

    BrokerService broker = BrokerFactory.createBroker (new URI (brokerUrl))
    broker.start () ; ("Broker Setup End") ;

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message