activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Hurst (JIRA)" <j...@apache.org>
Subject [jira] Commented: (AMQ-2283) New Multicast discovery agent thread is created for each message
Date Fri, 12 Jun 2009 11:13:35 GMT

    [ https://issues.apache.org/activemq/browse/AMQ-2283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=52225#action_52225
] 

Andrew Hurst commented on AMQ-2283:
-----------------------------------

Hi,

I have exactly the same problem and it eventually  leads to my application running out of
memory. I have had to disable multicast now for stability reasons but would like to use it
again so hopefully this can be fixed.

  <!-- configure the Camel JMS consumer to use the ActiveMQ broker declared above -->
    <bean id="jmsExternal" class="org.apache.camel.component.jms.JmsComponent">
        <property name="connectionFactory">
            <bean class="org.apache.activemq.ActiveMQConnectionFactory">
                <!-- use multicast to detect other broker - group=groupName of network
to look for -->
                <property name="brokerURL" value="discovery:(multicast://default?group=testbroker)?initialReconnectDelay=100"/>
            </bean>
        </property>
    </bean>

To send a message to the external queue "jmsExternal" I call the method in POJO object:

camelTemplate.sendBody(x,y);

I am using activeMQ 5.2.0 but the brokers which are being discovered are using the FUSE 5.3
version.

If select one of the thousands of Multicast threads displayed in Jconsole, they all have the
same stack trace as this:

Name: Multicast Discovery Agent Notifier
State: WAITING on java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@1ce7f98
Total blocked: 0  Total waited: 1

Stack trace:
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1925)
java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:358)
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
java.lang.Thread.run(Thread.java:619) 

BRegards
Andrew

> New Multicast discovery agent thread is created for each message
> ----------------------------------------------------------------
>
>                 Key: AMQ-2283
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2283
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.2.0
>         Environment: Linux, jdk6u13, jdk6u14
>            Reporter: eric
>
> I found out that a new thread is started for each message I send, but that thread is
staying alive for the whole program lifetime.
> The number of live "multicast discovery agent notifier" threads scales up linearly.
> Eventually I ended up with 10000 threads of the above type running
> It doesn't seems to be a camel issue since when I try with tcp://localhost:61616 everything
works fine.
> I'm suspecting a bug. and I wanted to share it with you before I open a ticket.
> Eric
> =============
> package com.mycompany.CamelExample;
> import javax.jms.ConnectionFactory;
> import org.apache.activemq.ActiveMQConnectionFactory;
> import org.apache.camel.CamelContext;
> import org.apache.camel.ProducerTemplate;
> import org.apache.camel.builder.RouteBuilder;
> import org.apache.camel.component.jms.JmsComponent;
> import org.apache.camel.impl.DefaultCamelContext;
> import org.apache.log4j.Logger;
> public final class App {
>    private static Logger log = Logger.getLogger("CamelTestApp");
>    public static void main(String args[]) throws Exception {
>         CamelContext context = new DefaultCamelContext();
>         ConnectionFactory connectionFactory =
>                     new ActiveMQConnectionFactory("failover:(discovery:(multicast://224.1.2.3:6255?group=default),tcp://localhost:61616)");
>         final String JMSTOPID = "test-jms";
>         final String DEST_TOPIC = "test-jms:topic:TCommandRequest";
>         final String SRC_TOPIC = "test-jms:topic:TCommandRequest";
>         context.addComponent("test-jms", JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));
>         context.addRoutes(new RouteBuilder() {
>             public void configure() {from(SRC_TOPIC).to("mock:test");}});
>         ProducerTemplate template = context.createProducerTemplate();
>         context.start();
>            while (true) {
>                 template.sendBody(DEST_TOPIC, "TEST_TEXT");
>                Thread.sleep(5000);
>             }
>     }
> }
> ======================
> My log shows:
> 12:02:06,212  INFO DefaultCamelContext:729 - Apache Camel 2.0-M1 (CamelContext:camel-1)
is starting
> 12:02:06,582  WARN ObjectHelper:523 - Cannot find class: org.apache.xalan.xsltc.trax.DOM2SAX
> 12:02:07,137  INFO DiscoveryTransport:73 - Adding new broker connection URL: tcp://192.168.0.1:61616
> 12:02:07,220  INFO FailoverTransport:714 - Successfully connected to tcp://192.168.0.1:61616
> 12:02:07,222  INFO FailoverTransport:714 - Successfully connected to discovery:(multicast://224.1.2.3:6255?group=default)
> 12:02:07,247  INFO DefaultCamelContext:771 - Apache Camel 2.0-M1 (CamelContext:camel-1)
started
> 12:02:07,640  INFO DiscoveryTransport:73 - Adding new broker connection URL: tcp://192.168.0.1:61616
> 12:02:07,715  INFO FailoverTransport:714 - Successfully connected to tcp://192.168.0.1:61616
> 12:02:07,716  INFO FailoverTransport:714 - Successfully connected to discovery:(multicast://224.1.2.3:6255?group=default)
> 12:02:13,181  INFO DiscoveryTransport:73 - Adding new broker connection URL: tcp://192.168.64.1:61616
> 12:02:13,220  INFO FailoverTransport:714 - Successfully connected to tcp://192.168.0.1:61616
> 12:02:13,222  INFO FailoverTransport:714 - Successfully connected to discovery:(multicast://224.1.2.3:6255?group=default)
> 12:02:18,731  INFO DiscoveryTransport:73 - Adding new broker connection URL: tcp://192.168.0.1:61616
> 12:02:18,961  INFO FailoverTransport:714 - Successfully connected to tcp://192.168.0.1:61616
> 12:02:18,963  INFO FailoverTransport:714 - Successfully connected to discovery:(multicast://224.1.2.3:6255?group=default)
> .
> .
> . 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message