activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dara kok <mrpc.cambo...@gmail.com>
Subject how to properly end msg receive in Async mode
Date Tue, 23 Mar 2010 02:45:10 GMT

Hello experts,

Can you tell how to properly end receiving msg in Asynch mode? i use the
code below to do it, but even after i press the enter key, the program still
runs:

[code]
consumer.setMessageListener(new ActiveMqListener());	        
consumer.start();
while(true){
    			BufferedReader in = new BufferedReader(new
InputStreamReader(System.in));
    			in.readLine();
    			System.out.print("ActiveMQ receive file ended.");
    			
    			//End the program.
    			consumer.stop();  
    			session.close();
    			connection.close();
    			System.exit(0);
}    		
[/code]
-- 
View this message in context: http://old.nabble.com/how-to-properly-end-msg-receive-in-Async-mode-tp27995765p27995765.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message