gemmellr commented on a change in pull request #3927:
URL: https://github.com/apache/activemq-artemis/pull/3927#discussion_r802566057
##########
File path:
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/RedeliveryPolicyTest.java
##########
@@ -479,6 +483,54 @@ public void testCountersAreCorrectAfterSendToDLQ() throws
Exception {
}
+ /**
+ * @throws Exception
+ */
+ @Test
+ public void testRedeliveryRefCleanup() throws Exception {
+
+ // Receive a message with the JMS API
+ RedeliveryPolicy policy = connection.getRedeliveryPolicy();
+ policy.setUseExponentialBackOff(false);
+ policy.setMaximumRedeliveries(-1);
+ policy.setRedeliveryDelay(50);
+
+ connection.start();
+ Session pSession = connection.createSession(true,
Session.AUTO_ACKNOWLEDGE);
+ Session cSession = connection.createSession(true,
Session.AUTO_ACKNOWLEDGE);
+ ActiveMQQueue destination = new ActiveMQQueue("TEST");
+ this.makeSureCoreQueueExist("TEST");
+ MessageProducer producer = pSession.createProducer(destination);
+ MessageConsumer consumer = cSession.createConsumer(destination);
+
+ TextMessage m;
+
+ for (int i = 0; i < 5; ++i) {
+ producer.send(pSession.createTextMessage("MessageText"));
+ pSession.commit();
+ m = (TextMessage) consumer.receive(2000);
+ assertNotNull(m);
+ cSession.rollback();
+ m = (TextMessage) consumer.receive(2000);
+ assertNotNull(m);
+ cSession.commit();
+ }
+
+ ServerConsumer serverConsumer = null;
+ for (ServerSession session : server.getSessions()) {
+ for (ServerConsumer sessionConsumer : session.getServerConsumers()) {
+ if (sessionConsumer.getQueue().getName().toString() == "TEST") {
+ serverConsumer = sessionConsumer;
+ }
+ }
+ }
+
+ AMQConsumer amqConsumer = (AMQConsumer) serverConsumer.getProtocolData();
+
assertTrue(AMQConsumerTest.getRolledbackMessageRefs(amqConsumer).isEmpty());
+ //assertTrue(amqConsumer.getRolledbackMessageRefs().isEmpty());
Review comment:
Leftover should be removed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]