On 8/21/06, Aaron Mulder <ammulder@alumni.princeton.edu> wrote:
> I ran a test where one publisher sent 10 messages to a topic with 500
> connected subscribers (run as 500 threads from a single VM, but in a
> different VM than the producer). Each consumer knows how many
> messages to expect, and tries to shut down once it receives the last
> message. The consumers were registered using
> MessageConsumer.setMessageListener(...)
>
> At the end of the run, the consumer VM didn't shut down. Looking at a
> thread dump, it seems like a couple of the consumers are blocked on
> I/O and aren't going to shut down (though the majority did shut down).
> I've confirmed that all the consumers received all the messages they
> were expecting, and did attempt to shut down (you can see
> ActiveMQSession.close in the thread dump). Any suggestions to avoid
> this?
>
> Thanks,
> Aaron
>
> "ActiveMQ Session Task" daemon prio=1 tid=0x082a1cd0 nid=0x3723 in
> Object.wait() [0x7bac5000..0x7bac6050]
> at java.lang.Object.wait(Native Method)
> - waiting on <0x97b91310> (a org.apache.activemq.thread.PooledTaskRunner$1)
> at java.lang.Object.wait(Object.java:474)
> at org.apache.activemq.thread.PooledTaskRunner.shutdown(PooledTaskRunner.java:88)
> - locked <0x97b91310> (a org.apache.activemq.thread.PooledTaskRunner$1)
> at org.apache.activemq.ActiveMQSessionExecutor.stop(ActiveMQSessionExecutor.java:113)
> at org.apache.activemq.ActiveMQSession.dispose(ActiveMQSession.java:539)
> - locked <0x9612ff30> (a org.apache.activemq.ActiveMQSession)
> at org.apache.activemq.ActiveMQSession.close(ActiveMQSession.java:516)
> at org.activemq.tests.ActiveMQClient.close(ActiveMQClient.java:77)
> at org.activemq.tests.Consumer$2$1.onMessage(Consumer.java:76)
> at org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageConsumer.java:795)
It doesn't look too good closing the session inside a MessageListener
- any chance you could change that code?
-
James
-------
http://radio.weblogs.com/0112098/
|