[jboss-user] [JBoss Messaging] - Client doesn't register lost connections..

frodeh do-not-reply at jboss.com
Thu Jan 11 16:55:17 EST 2007


I have a client listening an a queue, reading messages fine. But when I take down the server, and restarts it, the client only complains about problems sending lease-ping.

When the server gets back up, it doesn't move on in the code to recover-codet, and doesn't read any more messages.

I have tried looping with subscriber.recieve(5000) (looping on message == null), and with subscriber.recieve(0);.

Neither throws exceptions when sewrver goes down, and the reconnect-code is never executed.

		while (true)
  | 			try {
  | 
  | 				MessageConsumer subscriber = session.createConsumer(dest);
  | 				while (true) {
  | 					TextMessage message = null;
  | 					while (message == null) {
  | 						message = (TextMessage) subscriber.receive(0);
  | 						if (message==null)  log.info("looping wait...");
  | 					}
  | 					log.info(message.getText());
  | 					String host = message.getText();
  | 					 rt.exec("iptables -I killSSH 1 -t nat -s " + host + " -j DNAT --to " + host);
  | 				}
  | 			} catch (JMSException e) {
  | 				e.printStackTrace();
  | 				recoverJMS();
  | 			} catch (Exception e) {
  | 				// TODO Auto-generated catch block
  | 				e.printStackTrace();
  | 				log.error("Could not add to IPTables, exiting...");
  | 				return;
  | 			}
  | 

How can I get the recieve-method to actually fail if the connection is lost, and then reconnect in the JMSException-catch ?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4000613#4000613

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4000613



More information about the jboss-user mailing list