0 Replies Latest reply on Sep 20, 2005 1:49 PM by Kirill Protsenko

    InterruptedException in SpyMessageConsumer

    Kirill Protsenko Newbie

      Hello,

      I have a thread that attempts to receive JMS messages. Occassionally, I am getting java.lang.InterruptedException rethrown as JMSException. Here is the JBoss code that rethrows the InterruptedException :

      http://anoncvs.forge.jboss.com/viewrep/JBoss/jbossmq/src/main/org/jboss/mq/SpyMessageConsumer.java?r=1.36

      lines 313-346

      try
      
       {
       waitingForMessage = true;
       while (true)
      
       if (closed) {
       if (trace)
       log.trace("Consumer closed in receive() " + this);
       return null;
       }
       Message mes = getMessage();
      
       if (mes != null) {
       if (trace)
       log.trace("receive() message from list after wait " + this);
       return mes;
       }
       messages.wait();
       }
      }
      catch (Throwable t)
       {
       SpyJMSException.rethrowAsJMSException("Receive interupted", t);
      throw new UnreachableStatementException();
      }
       finally
       {
       waitingForMessage = false;
      synchronized (stateLock)
       {
       receiving = false;
      }
       }



      Thanks for any suggestions and pointers.