labranch
Feb 13th, 2012, 05:52 PM
Hello,
I am using the 20120213 build of 1.0.1 so that I don't have leaking channels. I want to do something like this (amqpTemplate has channel-transacted="true"):
@Transactional
public void test() {
for(int i=0; i < 10; i++) {
// some database add's are happening here...
amqpTemplate.convertAndSend("TEST");
// this allows me to watch the queue in the RabbitMQ admin
try { Thread.sleep(15000); } catch (InterruptedException e) { ; }
}
String test = null;
if(test.endsWith("test")) { ; }
}
As you can see the code loops 10 times and tries to send a message every 15 seconds. I'm expecting not to see the messages in the queue because at the end a NullPointerException is thrown and the transaction should roll back. I see all 10 messages, 1 appearing every 15 seconds, and they don't roll back. Is this the expected behavior or is this a bug?
Thanks so much,
Jason
I am using the 20120213 build of 1.0.1 so that I don't have leaking channels. I want to do something like this (amqpTemplate has channel-transacted="true"):
@Transactional
public void test() {
for(int i=0; i < 10; i++) {
// some database add's are happening here...
amqpTemplate.convertAndSend("TEST");
// this allows me to watch the queue in the RabbitMQ admin
try { Thread.sleep(15000); } catch (InterruptedException e) { ; }
}
String test = null;
if(test.endsWith("test")) { ; }
}
As you can see the code loops 10 times and tries to send a message every 15 seconds. I'm expecting not to see the messages in the queue because at the end a NullPointerException is thrown and the transaction should roll back. I see all 10 messages, 1 appearing every 15 seconds, and they don't roll back. Is this the expected behavior or is this a bug?
Thanks so much,
Jason