activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kolton <kand...@mshare.net>
Subject Multicast Discovery Agent Notifier
Date Tue, 22 Jul 2008 23:42:09 GMT

Hey all, 

     Question regarding the daemon thread "Multicast Discovery Agent
Notifier".  I've spent a fair amount of time searching for a similar issue
and looking through the source, so my apologies if this is a waste of time. 
I'm running Tomcat 2.2.26 with a Broker started via Spring using ActiveMQ
4.1.2.  Every time I execute this block of code:

     public String getMasterBrokerURL() {
		String brokerURL = "";
		try {
	  		ActiveMQConnection connection = ((ActiveMQConnection)
getConnectionFactory().createConnection());
			connection.start();
			
			if (connection.getBrokerInfo() != null) {
				brokerURL = connection.getBrokerInfo().getBrokerURL();
			}
			connection.cleanup();
			connection.close();
		} catch (JMSException e) {
                  // logging
		} catch( Throwable t){
                  // catch anything odd
		}
		return brokerURL;
     }


I end up with about 3 more Daemon Threads named "Multicast Discovery Agent
Notifier".  These don't appear to go away, and eventually cause a leak in
Tomcat resulting in OOM Exceptions.


Connection factory configured as follows:
     <!--  JMS Admin Service Connection -->
    <bean id="jmsStatusConnectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
    	<!-- User Name <constructor-arg ></constructor-arg>-->
    	<!-- Password <constructor-arg></constructor-arg>-->
    	<constructor-arg
value="discovery:(multicast://default)?trace=true&amp;wireFormat.maxInactivityDuration=5000&amp;jms.closeTimeout=5000&amp;wireFormat.soTimeout=5000"></constructor-arg>
    </bean> 

I have added the extra parameters to the URI for debugging/testing purposes. 
I get this same behavior if I create it using only
"discovery:(multicast://default)".

Broker transport/network connectors (if useful):
        <transportConnectors>
	       <transportConnector brokerName="msBroker" name="openwire"
discoveryUri="multicast://default" uri="tcp://localhost:61616"/>
	    </transportConnectors>
	    
	    <networkConnectors>
	      <networkConnector brokerName="msBroker" name="msNetworkConnetor"
networkTTL="10" failover="true" uri="multicast://default"/>
	    </networkConnectors>
    

First question, is this an obviously bad way to find out who is currently
the master broker for some reason I'm missing?

Second question, am I not cleaning something up/misusing something that
results in this leak?

Or is there something more here?

Any help is greatly appreciated!

Thanks,

Kolton


-- 
View this message in context: http://www.nabble.com/Multicast-Discovery-Agent-Notifier-tp18601154p18601154.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.


Mime
View raw message