activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nanik <nanikj...@yahoo.com>
Subject Re: vm question
Date Sun, 20 Jan 2008 06:34:48 GMT

Ok I managed to get it working, all that was left out was the following line
of code

 connection.start();
 
When digging through the ActiveMQ source code I found that the message was
infact received by the VMTransport side on the client and it was pass
through until it was ready to be picked up by the consumer, but when the
consumer wants to consume it, it was not able to as the flag (running
property) of the MessageDispatchChannel object which resides inside the
ActiveMQSessionExecutor object was not set to true (which would have been
set to true once I use the connection.start() ) method.

The method that was called to check whether a message can be retrieved in
the MessageDispatchChannel object is  the following snippet,

  public MessageDispatch dequeueNoWait() {
        synchronized (mutex) {
            if (closed || !running || list.isEmpty()) { <--------------- the
running property is false
                return null;
            }
            return list.removeFirst();
        }
    }
    
    
When the ActiveMQSession object is created, the code in the constructor
check whether the connection has been started, if it has been started then a
chain of flag settings and initialization started and one of the flag
settings is the setting of the running property of the
MessageDispatchChannel object
-- 
View this message in context: http://www.nabble.com/vm-question-tp14977039s2354p14978989.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message