-
1. Re: message.getDeliveryCount is always 1
jbertram Jun 2, 2015 10:13 AM (in response to jgabrielygalan)From what I can tell this is working as expected. You need to acknowledge the message first and then rollback or the message won't be considered "delivered" in the first place.
-
2. Re: message.getDeliveryCount is always 1
jgabrielygalan Jun 2, 2015 10:52 AM (in response to jbertram)Thanks Justin.
Looks like I didn't test a specific combination: creating the session without autoCommitAcks and acknowledging before either commiting and rollbacking. It is confusing for me, since with autocommitAcks and no ack, the session.rollback() produces that the message is sent again. For the record, this works:
session = sf.createSession(true, false);
consumer = session.createConsumer("queue");
while (true) {
ClientMessage message = consumer.receive();
message.acknowledge();
if (processMessageOK(message)) {
session.commit();
} else {
session.rollback();
}
}
Thanks,
Jesus.