Thank you for the example, I have it working now.
Let me ask a final question regarding JMS and CLIENT_ACKNOWLEDGE rooted in the machanics of JMS rather than specifically with JBoss's implementation.
Let us say we have two MDB listening to the same queue. The message gets delivered to the first MDB, but this MDB does not acknowledge the message. Does the second MDB need to call the session.recover method in order to be able to pick-up this unacknowledged message?
Also, from a timing perspective, what triggers a message to be determined re-deliverable? For example, I may want to have a message delivered to a MDB, perform some operations that may take a few seconds or a minute, and then depending on the success of the operations acknowledge the message or leave it unacknowledged for a different MDB to fetch or for this same MDB to fetch at a near future time.
Each MDB gets their own session (which you don't have access to anyway).
If you don't acknowledge a message, it will be marked redelivered the next
time it is delivered. This could also happen due to network/client/server failure
or transaction rollback, not just client acknowledge.