3 Replies Latest reply on Jan 11, 2005 11:29 AM by Tim Price

    JMS fills up database

    Tim Price Newbie

      We occasionally get errors when a JMS topic subscriber disconnects. It appears that sometimes the server does not know that a subscriber has disconnected and generates the following error:

      2005-01-06 23:05:32,156 WARN [org.jboss.mq.server.ClientConsumer] Could not send messages to a receiver.
      java.net.SocketException: Connection reset
      at java.net.SocketInputStream.read(SocketInputStream.java:168)
      at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
      at java.io.BufferedInputStream.read(BufferedInputStream.java:201)
      at org.jboss.util.stream.NotifyingBufferedInputStream.read(NotifyingBufferedInputStream.java:67)
      at java.io.ObjectInputStream$PeekInputStream.peek(ObjectInputStream.java:2133)
      at java.io.ObjectInputStream$BlockDataInputStream.readBlockHeader(ObjectInputStream.java:2316)
      at java.io.ObjectInputStream$BlockDataInputStream.refill(ObjectInputStream.java:2383)
      at java.io.ObjectInputStream$BlockDataInputStream.read(ObjectInputStream.java:2455)
      at java.io.ObjectInputStream$BlockDataInputStream.readByte(ObjectInputStream.java:2604)
      at java.io.ObjectInputStream.readByte(ObjectInputStream.java:845)
      at org.jboss.mq.il.uil2.SocketManager$ReadTask.run(SocketManager.java:279)
      at java.lang.Thread.run(Thread.java:536)
      2005-01-06 23:05:32,159 ERROR [org.jboss.mq.server.JMSDestinationManager] The connection to client ID:1 failed.

      This causes *all* subsequent JMS_MESSAGES destined for the disconnected subscriber to be added to the JMS_MESSAGES table. Since this application runs 24/7, this eventually causes nasty things to happen with the database.

      The configuration we are using is:

      Release ID: JBoss [Zion] 4.0.0 (build: CVSTag=JBoss_4_0_0 date=200409200418)
      Java version: 1.4.1_07,Sun Microsystems Inc.
      Java VM: Java HotSpot(TM) Server VM 1.4.1_07-b02,Sun Microsystems Inc.
      OS-System: Linux 2.4.7-10,i386
      Oracle

      We have also seen the same problem with JBoss 3.2.2, Windows 2K, HSQLDB. I'm trying to avoid turning on tracing because we have dozens of clients subscribed to receive messages at once second intervals and the errors occur so infrequently. However when they do occur, it obviously causes big problems.

      Any pointers?
      Tim.

        • 1. Re: JMS fills up database
          Adrian Brock Master

           

          "tprice" wrote:
          We occasionally get errors when a JMS topic subscriber disconnects. It appears that sometimes the server does not know that a subscriber has disconnected and generates the following error:

          2005-01-06 23:05:32,159 ERROR [org.jboss.mq.server.JMSDestinationManager] The connection to client ID:1 failed.


          Looks to me like the server detected the client vanished


          This causes *all* subsequent JMS_MESSAGES destined for the disconnected subscriber to be added to the JMS_MESSAGES table. Since this application runs 24/7, this eventually causes nasty things to happen with the database.

          The configuration we are using is:

          Release ID: JBoss [Zion] 4.0.0 (build: CVSTag=JBoss_4_0_0 date=200409200418)
          Java version: 1.4.1_07,Sun Microsystems Inc.
          Java VM: Java HotSpot(TM) Server VM 1.4.1_07-b02,Sun Microsystems Inc.
          OS-System: Linux 2.4.7-10,i386
          Oracle

          We have also seen the same problem with JBoss 3.2.2, Windows 2K, HSQLDB. I'm trying to avoid turning on tracing because we have dozens of clients subscribed to receive messages at once second intervals and the errors occur so infrequently. However when they do occur, it obviously causes big problems.

          Any pointers?
          Tim.


          Don't use durable subscriptions if you don't want the messages retained.

          From the destination manager:
           // This is where it prints your message
           public void connectionFailure(ConnectionToken dc) throws JMSException
           {
           log.error("The connection to client " + dc.getClientID() + " failed.");
           connectionClosing(dc);
           }
          
           public void connectionClosing(ConnectionToken dc) throws JMSException
           {
           if (dc == null)
           return;
          
           // Close it's ClientConsumer
           ClientConsumer cq = (ClientConsumer) clientConsumers.remove(dc);
           if (cq != null)
           cq.close();
          ...
          
          


          cq.close() is what removes non durable subscriptions.
          Unless you can show me otherwise.

          See the WIKI about why you shouldn't use HSQLDB.

          • 2. Re: JMS fills up database
            naveen kumar Newbie

            Thanks yaar

            • 3. Re: JMS fills up database
              Tim Price Newbie

              Thanks Adrian for the resposne.

              I'm creating a subscriber using:

              topicSubscriber = session.createSubscriber(topic);

              which, I think, should default to a non durable subscription. Is there something else I need to do?

              Tim.