]
Joel Lindheimer updated JBMESSAGING-477:
----------------------------------------
Attachment: TestConsumer.java
Ovidiu/Tim,
this is the same consumer as in my other tests...
1. Run it by commenting out the following section (also comment out the configHelper
import so it will compile without our codebase) so it rolls back every time:
// if(ConfigHelper.getBoolean("test.jms.consumer.commit")) {
// ut.commit();
// } else {
ut.rollback();
//}
2. Then add the following block to your startup servlet init() method:
TestConsumer tc = new TestConsumer();
Thread thread = new Thread(tc);
thread.setDaemon(true);
thread.start();
3. Then send messages to "queue/A" (i will also attach a client sender)
4. Then stop and start the server after the messages stop being processed.
Messages are left in the Messages table after retry message is
printed and are retried every time the server is restarted
-------------------------------------------------------------------------------------------------------------------------
Key: JBMESSAGING-477
URL:
http://jira.jboss.com/jira/browse/JBMESSAGING-477
Project: JBoss Messaging
Issue Type: Bug
Components: Messaging Core
Affects Versions: 1.0.1.CR2
Environment: Windows XP
Reporter: Joel Lindheimer
Assigned To: Ovidiu Feodorov
Attachments: TestConsumer.java
I am testing Consumer.receive() with a userTransaction rollback scenario; the messages
rollback and are retried. Eventually the follwoing message is printed:
JBossMessage[49410]:PERSISTENT has exceed maximum delivery attempts and will be removed.
However, the messages are never deleted from the messages table; it is therefore retried
upon every subsequent server restart.
To reproduce just send a simple message with a consumer that does the following:
while (true) {
log.warn("whileloop+");
ut = (UserTransaction)
getInitialContext().lookup("UserTransaction");
ut.begin();
conn = (QueueConnection) this.getQueueFactory().createQueueConnection();
conn.start();
session = conn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
receiver = session.createReceiver(getQueue());
// Note: starting the ut here does causes other issues... so i moved it
up
// ut = (UserTransaction)
getInitialContext().lookup("UserTransaction");
// ut.begin();
TextMessage msg = (TextMessage) receiver.receive(5000);
receiver.close();
session.close();
conn.close();
log.warn("msg: " + msg);
if(msg!=null) {
log.warn("msg.text: " +msg.getText());
}
ut.rollback();
(...)
Here is the server console print:
12:41:30,946 WARN [TestConsumer] msg: null
12:41:30,946 WARN [TestConsumer] whileloop-
12:41:30,946 WARN [TestConsumer] whileloop+
12:41:30,946 WARN [TestConsumer] msg: delegator->JBossMessage[49410]:PERSISTENT
12:41:30,946 WARN [TestConsumer] msg.text: Payload #2
12:41:30,946 WARN [TestConsumer] whileloop-
12:41:30,946 WARN [TestConsumer] whileloop+
12:41:30,946 WARN [TestConsumer] msg: delegator->JBossMessage[49410]:PERSISTENT
12:41:30,946 WARN [TestConsumer] msg.text: Payload #2
12:41:30,946 WARN [TestConsumer] whileloop-
12:41:30,946 WARN [TestConsumer] whileloop+
12:41:30,962 WARN [TestConsumer] msg: delegator->JBossMessage[49410]:PERSISTENT
12:41:30,962 WARN [TestConsumer] msg.text: Payload #2
12:41:30,962 WARN [TestConsumer] whileloop-
12:41:30,962 WARN [TestConsumer] whileloop+
12:41:30,962 WARN [TestConsumer] msg: delegator->JBossMessage[49410]:PERSISTENT
12:41:30,962 WARN [TestConsumer] msg.text: Payload #2
12:41:30,962 WARN [TestConsumer] whileloop-
12:41:30,962 WARN [TestConsumer] whileloop+
12:41:30,962 WARN [TestConsumer] msg: delegator->JBossMessage[49410]:PERSISTENT
12:41:30,962 WARN [TestConsumer] msg.text: Payload #2
12:41:30,962 WARN [TestConsumer] whileloop-
12:41:30,962 WARN [TestConsumer] whileloop+
12:41:30,962 WARN [TestConsumer] msg: delegator->JBossMessage[49410]:PERSISTENT
12:41:30,962 WARN [TestConsumer] msg.text: Payload #2
12:41:30,962 WARN [TestConsumer] whileloop-
12:41:30,962 WARN [TestConsumer] whileloop+
12:41:30,977 WARN [TestConsumer] msg: delegator->JBossMessage[49410]:PERSISTENT
12:41:30,977 WARN [TestConsumer] msg.text: Payload #2
12:41:30,977 WARN [TestConsumer] whileloop-
12:41:30,977 WARN [TestConsumer] whileloop+
12:41:30,977 WARN [TestConsumer] msg: delegator->JBossMessage[49410]:PERSISTENT
12:41:30,977 WARN [TestConsumer] msg.text: Payload #2
12:41:30,977 WARN [TestConsumer] whileloop-
12:41:30,977 WARN [TestConsumer] whileloop+
12:41:31,009 WARN [TestConsumer] msg: delegator->JBossMessage[49410]:PERSISTENT
12:41:31,009 WARN [TestConsumer] msg.text: Payload #2
12:41:31,009 WARN [TestConsumer] whileloop-
12:41:31,009 WARN [TestConsumer] whileloop+
12:41:31,009 WARN [TestConsumer] msg: delegator->JBossMessage[49410]:PERSISTENT
12:41:31,009 WARN [TestConsumer] msg.text: Payload #2
12:41:31,009 WARN [TestConsumer] whileloop-
12:41:31,009 WARN [TestConsumer] whileloop+
12:41:31,024 WARN [TestConsumer] msg: delegator->JBossMessage[49410]:PERSISTENT
12:41:31,024 WARN [TestConsumer] msg.text: Payload #2
12:41:31,024 WARN [TestConsumer] whileloop-
12:41:31,024 WARN [TestConsumer] whileloop+
12:41:31,024 WARN [ServerConsumerEndpoint] JBossMessage[49410]:PERSISTENT has exceed
maximum delivery attempt
s and will be removed
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: