6 Replies Latest reply on May 15, 2003 8:30 PM by Adrian Brock

    Uncommitted messages not re-delivered from persistent topics

    sys user Master

      Is there a bug in Jboss in which uncommitted messages are not re-delivered from a persistent topic after Jboss is stopped/started? Stated another way, messages are received correctly, however, when JMS goes down messages never get re-delivered once JMS comes back up if the message was uncommitted. The file persistence directory has the message stored on the disk, but it never gets re-delivered. It looks like this is *not* a problem with queues.

        • 1. Re: Uncommitted messages not re-delivered from persistent to
          Adrian Brock Master

          Which version of jboss?
          There have been a number of fixes done in
          this area starting with jboss-3.0.4

          Regards,
          Adrian

          • 2. Re: Uncommitted messages not re-delivered from persistent to
            sys user Master

            Our version is jboss-3.0.6.
            Thanks for responding,
            dsg.

            • 3. Re: Uncommitted messages not re-delivered from persistent to
              Adrian Brock Master

              Can post a testcase or a least more information?

              Try 3.0.7 as well. Although I don't remember
              any specific fixes, the changes I did make were
              back in November though.

              Regards,
              Adrian

              • 4. Re: Uncommitted messages not re-delivered from persistent to
                Adrian Brock Master

                Can post a testcase or a least more information?

                Try 3.0.7 as well. Although I don't remember
                any specific fixes, the changes I did make were
                back in November though.

                Regards,
                Adrian

                • 5. Re: Uncommitted messages not re-delivered from persistent to
                  Chad Stone Newbie

                  I work with dsg, and I can provide a little more info. Any simple client program that can durably subscribe using transactional semantics can be used to reproduce this:

                  1) Publish a message to a topic for which there is a durable subscription (and commit the publish transaction).

                  2) Read the message using a client subscribing to the durable subscription, and use a transactional topic session. The onMessage() method should have the following basic elements: a println() statement to spit out the message contents verifying that the message was received, followed by a Thread.sleep() statement, followed by the topicSession.commit().

                  3) During runtime, shut down the JBoss MQ server while the sleep() statement is sleeping (i.e. after the message was retrieved by the client, but before it was comitted).

                  4) After the client wakes up (and complains that the server is gone), kill it and then restart the JBossMQ server.

                  5) Re-run the subscribing client program; it will not receive the message that was previously read but not comitted. Furthermore, the JBossMQ file persistence directory for the durable subscription will contain a message file for this message, but for some reason (a bug?!?) JBoss MQ does not try to deliver it to the subscribing client. The message effectively gets lost from the subscribing client's perspective. This is very bad.

                  Hope this helps...
                  Chad

                  • 6. Re: Uncommitted messages not re-delivered from persistent to
                    Adrian Brock Master

                    I just tried this, it works for me.

                    I tried both queues and durable topic subscriptions.

                    I did try it with 3.0.8RC1 and 3.2.2beta, but there
                    no specific fixes over 3.0.7 and 3.2.1

                    I also tried it with MDBs

                    I tried java 1.3.1_06 and 1.4.1_02

                    I tried linux and windows.

                    I tried file and jdbc2 persistence.

                    The steps:
                    Publish a message with a subscriber waiting in
                    onMesasge

                    The subscriber sleeps before committing.

                    Kill jboss while it sleeps

                    Kill the client (actually System.exit in the exception listener)

                    Restart jboss

                    Restart the subscriber

                    The message is redelivered

                    Regards,
                    Adrian

                    bash-2.05$ ant subscribe
                    Buildfile: build.xml

                    compile:

                    subscribe:
                    [java] listening
                    [java] org.jboss.mq.SpyMessage {
                    [java] Header {
                    [java] jmsDestination : TOPIC.testTopic.DurableSubscriberExample.test
                    [java] jmsDeliveryMode : 2
                    [java] jmsExpiration : 0
                    [java] jmsPriority : 4
                    [java] jmsMessageID : ID:1-10530484462141
                    [java] jmsTimeStamp : 1053048446214
                    [java] jmsCorrelationID: null
                    [java] jmsReplyTo : null
                    [java] jmsType : null
                    [java] jmsRedelivered : false
                    [java] jmsPropertiesReadWrite:false
                    [java] msgReadOnly : true
                    [java] producerClientId: ID:1
                    [java] }
                    [java] }
                    [java] org.jboss.mq.SpyJMSException: Exiting on IOE; - nested throwable: (java.net.SocketException: Connection rese
                    t)
                    [java] at org.jboss.mq.Connection.asynchFailure(Connection.java:718)
                    [java] at org.jboss.mq.il.uil2.UILClientILService.asynchFailure(UILClientILService.java:145)
                    [java] at org.jboss.mq.il.uil2.SocketManager$ReadTask.handleStop(SocketManager.java:394)
                    [java] at org.jboss.mq.il.uil2.SocketManager$ReadTask.run(SocketManager.java:331)
                    [java] at java.lang.Thread.run(Thread.java:536)
                    [java] Caused by: java.net.SocketException: Connection reset
                    [java] at java.net.SocketInputStream.read(SocketInputStream.java:168)
                    [java] at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
                    [java] at java.io.BufferedInputStream.read(BufferedInputStream.java:201)
                    [java] at org.jboss.util.stream.NotifyingBufferedInputStream.read(NotifyingBufferedInputStream.java:67)
                    [java] at java.io.ObjectInputStream$PeekInputStream.peek(ObjectInputStream.java:2133)
                    [java] at java.io.ObjectInputStream$BlockDataInputStream.readBlockHeader(ObjectInputStream.java:2316)
                    [java] at java.io.ObjectInputStream$BlockDataInputStream.refill(ObjectInputStream.java:2383)
                    [java] at java.io.ObjectInputStream$BlockDataInputStream.read(ObjectInputStream.java:2455)
                    [java] at java.io.ObjectInputStream$BlockDataInputStream.readByte(ObjectInputStream.java:2604)
                    [java] at java.io.ObjectInputStream.readByte(ObjectInputStream.java:845)
                    [java] at org.jboss.mq.il.uil2.SocketManager$ReadTask.run(SocketManager.java:278)
                    [java] ... 1 more

                    BUILD SUCCESSFUL
                    Total time: 21 seconds
                    bash-2.05$ ant subscribe
                    Buildfile: build.xml

                    compile:

                    subscribe:
                    [java] listening
                    [java] org.jboss.mq.SpyMessage {
                    [java] Header {
                    [java] jmsDestination : TOPIC.testTopic.DurableSubscriberExample.test
                    [java] jmsDeliveryMode : 2
                    [java] jmsExpiration : 0
                    [java] jmsPriority : 4
                    [java] jmsMessageID : ID:1-10530484462141
                    [java] jmsTimeStamp : 1053048446214
                    [java] jmsCorrelationID: null
                    [java] jmsReplyTo : null
                    [java] jmsType : null
                    [java] jmsRedelivered : false
                    [java] jmsPropertiesReadWrite:false
                    [java] msgReadOnly : true
                    [java] producerClientId: ID:1
                    [java] }
                    [java] }
                    [java] done