Uploaded image for project: 'A-MQ Broker'
  1. A-MQ Broker
  2. ENTMQBR-3859

[LTS] LVQ + non-destructive not deliverying message to existing consumer

    Details

    • Target Release:
    • Steps to Reproduce:
      Hide

      Add this to org.apache.activemq.artemis.tests.integration.jms.client.LVQTest

      @Test
      public void testLVQandNonDestructive() throws Exception {
         ActiveMQConnectionFactory fact = (ActiveMQConnectionFactory) getCF();
         fact.setConsumerWindowSize(0);      
      
         try (Connection connection = fact.createConnection();
              Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE)) {         
      
            // swapping these two lines makes the test either succeed for fail
            // Queue queue = session.createQueue("random?last-value=true");
            Queue queue = session.createQueue("random?last-value=true&non-destructive=true");
      
            MessageProducer producer = session.createProducer(queue);
            MessageConsumer consumer = session.createConsumer(queue);
      
            connection.start();
      
            TextMessage message = session.createTextMessage();
            message.setText("Message 1");
            message.setStringProperty(Message.HDR_LAST_VALUE_NAME.toString(), "A");
            producer.send(message);
      
            TextMessage tm = (TextMessage) consumer.receive(2000);
            assertNotNull(tm);
            tm.acknowledge();
            assertEquals("Message 1", tm.getText());
      
            message = session.createTextMessage();
            message.setText("Message 2");
            message.setStringProperty(Message.HDR_LAST_VALUE_NAME.toString(), "A");
            producer.send(message);
      
            tm = (TextMessage) consumer.receive(2000);
            assertNotNull(tm);
            assertEquals("Message 2", tm.getText());
         }
      }
      
      Show
      Add this to org.apache.activemq.artemis.tests.integration.jms.client.LVQTest @Test public void testLVQandNonDestructive() throws Exception { ActiveMQConnectionFactory fact = (ActiveMQConnectionFactory) getCF(); fact.setConsumerWindowSize(0); try (Connection connection = fact.createConnection(); Session session = connection.createSession( false , Session.CLIENT_ACKNOWLEDGE)) { // swapping these two lines makes the test either succeed for fail // Queue queue = session.createQueue( "random?last-value= true " ); Queue queue = session.createQueue( "random?last-value= true &non-destructive= true " ); MessageProducer producer = session.createProducer(queue); MessageConsumer consumer = session.createConsumer(queue); connection.start(); TextMessage message = session.createTextMessage(); message.setText( "Message 1" ); message.setStringProperty(Message.HDR_LAST_VALUE_NAME.toString(), "A" ); producer.send(message); TextMessage tm = (TextMessage) consumer.receive(2000); assertNotNull(tm); tm.acknowledge(); assertEquals( "Message 1" , tm.getText()); message = session.createTextMessage(); message.setText( "Message 2" ); message.setStringProperty(Message.HDR_LAST_VALUE_NAME.toString(), "A" ); producer.send(message); tm = (TextMessage) consumer.receive(2000); assertNotNull(tm); assertEquals( "Message 2" , tm.getText()); } }
    • Release Notes Text:
      Previously, if a client acknowledged a message on a non-destructive last value queue, and that message was subsequently replaced by another last value, the broker did not deliver the message to the client. This issue is resolved.
    • Release Notes Docs Status:
      Documented as Resolved Issue
    • QE Test Coverage:
      +
    • Verified:
      Verified in a release

      Description

      When a client acknowledges a message on a non-destructive LVQ and that message is subsequently replaced by another "last value" the broker does not deliver this message to the client.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  jbertram Justin Bertram
                  Reporter:
                  dbruscin Domenico Francesco Bruscino
                  Tester:
                  Tiago Bueno
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: