activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Pederzolli <>
Subject Re: AMQ 3.2/Spring/Jencks/POJO and XA Transactions
Date Tue, 04 Apr 2006 16:24:16 GMT

I have continued trying to solve this bug, and am currently running AMQ 4.0

I found what seems to be the source of the infinite loop - in, in the method dequeueNoWait (line 91):

    public MessageDispatch dequeueNoWait() {
        synchronized (mutex) {
            if (closed || !running || list.isEmpty()) {
                return null;
            return (MessageDispatch) list.removeFirst();

The thread that keeps on spinning has values of closed=false, running=false,
and a nonEmpty list. With those values, a null is returned up to the run()
method of (line 640), causing it do do nothing and then
finally up to's run() method (line 156) where in the
finally block the following code that is responsible for breaking out of the
while loop (line 170):

            finally {
                log.debug("run loop end");            
                synchronized (runControlMutex) {
                    // This endpoint may have gone stale due to error
                    if( stale) {
                        runningFlag = false;
                    if( !session.hasUncomsumedMessages() ) {
                        runningFlag = false;

Neither break statement is hit since the endpoint is not stale and it has
unconsumed messages - and the infinite loop begins. 

I am not familiar enough with the code to say their is a bug in any of the
classes I just mentioned or there is an external class which is causing the
problem. Do you have any insight into this? I am more than willing to assist
or give additional debug information if needed.  

- John

View this message in context:
Sent from the ActiveMQ - User forum at

View raw message