Im working in an multithreaded application, it takes objects from a queue and processes them. I have been using manual acknowledgment. Basically, if my code reachs some point (aka, no exceptions nor errors), i acknowledge the message, otherwise i dont. But i have a problem, i cant send a failure-acknowledgement. I mean, until my session/connection closes (in real operation, theorically never), the message will remain delivering and i cant say something like "leave it, it failed". I know acknoledgement its about checking network failures and such. But it would be nice if there is a way to do this.
Simply create the session transacted and rollback.
I use same queueReceiver/sender for all threads (i can change this, but i suposse/tested a little they are thread-safe?) and i would like to rollback only one message.
Yes, sessions are not JMS resources are not meant to be accessed by multiple threads, use 1 session/producer/consumer per thread, this will also speed up your app.