[JBoss Messaging] - Client doesn't register lost connections..
by frodeh
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
19 years, 3 months
[JBoss Messaging] - MessageConsumer thread never goes away
by chip_schoch
I have a service that listens to and services JMS queues. I have been starting and stopping it and have been watching the thread count grow. Through a tedious trial and error session I have determined that the thread that is produced when javax.jms.Session.createConsumer() never goes away.
I am calling MessageConsumer.close() but the thread stays around. Even after I undeploy my service the thread that was created by it remains. I did this by remote debugging my JBoss server using eclipse and looking at the threads. I even wrote a simple test program that crated a consumer then closed it and I stepped through it watching it create the thread. When I stepped through the close method it di ot go away.
Has anyone else seen this? This is a huge show stopper for us, as this won't run like this too long before all the resources are exhausted.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4000612#4000612
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4000612
19 years, 3 months