Search code examples
javaglassfishjmsjava-ee-6

Return bean-type transaction to queue


We have an application deployed to a glassfish server with an MDB that, for other reasons, must use Bean-type transactions (TransactionManagementType.BEAN).

In certain situations, inside the onMessage() method we'd like to be able to look at the message and refuse it. By "refuse" I mean put the message back on the queue and have it be re-delivered later.

I've searched around a bit but all that I've found seems to say that I should just change the transaction type to Container and call setRollbackOnly(). However, as I said above that's not an option due to other constraints.

Is there any way to do this?


Solution

  • Look at this:

    http://www.datadisk.co.uk/html_docs/ejb/ejb3_mdb.htm

    It says that in Client-acknowledge mode is not supported in MDB.