Uploaded image for project: 'JBoss A-MQ'
  1. JBoss A-MQ
  2. ENTMQ-595

Clarification of redelivery behavior when have ungraceful exit of a transacted client

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • JBoss A-MQ 6.2
    • None
    • None
    • None

    Description

      Have the following code snippet, client is transacted:

        public void onMessage(Message message) {
      
                      try {
                          if (message instanceof TextMessage) {
      	
                              TextMessage textMessage = (TextMessage) message;
                              System.out.println("Message:"+((TextMessage) message).getText().toString().toLowerCase());
                              //System.exit(1);
                              if (((TextMessage) message).getText().toString().toLowerCase().contains("HELLO".toLowerCase()))
                              {
                              	System.out.println("Yes");
                              	message.acknowledge();
                              	System.exit(1);
                              	session.close();
                              	session.commit();
                              }
      
      

      The client does a system.exit before the message is committed or rolledback.

      The message gets rolled back to the destination, but the redelivery count is not incremented - so the message is never bounced to the DLQ in this scenario.

      If we explicitly call rollback(), the message is sent to the DLQ after 7 attempts.

      Question is just to check if this is expected behavior. I had a look at the JMS spec but didn't see this scenario addressed anywhere.

      Attachments

        1. testcase.zip
          12 kB
        2. TestCase.zip
          4 kB

        Issue Links

          Activity

            People

              gtully@redhat.com Gary Tully
              davestanley Dave Stanley (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: