activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davidnewcomb <david.newc...@bigsoft.co.uk>
Subject Embedding a broken in spring
Date Wed, 13 Feb 2008 17:52:08 GMT

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 java.net.URI;

import org.apache.activemq.broker.BrokerFactory;
import org.apache.activemq.broker.BrokerService;

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
    {
    logger.info ("Broker Setup") ;

    BrokerService broker = BrokerFactory.createBroker (new URI (brokerUrl))
;
    broker.start () ;

    logger.info ("Broker Setup End") ;
    }
  }

Thanks
-- 
View this message in context: http://www.nabble.com/Embedding-a-broken-in-spring-tp15461571s2354p15461571.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message