Hi,
I have an EJB3 MDB listening to a queue, running in GlassFish v3. I want it to perform a function, but if it fails, to retry later. I also want it to keep retrying until it succeeds, and I am not worried about poison messages.
So, using Container Managed Transactions (CMT) within my MDB, and the default transaction type of 'Required', I can have the context injected, and on failure I can use the setRollbackOnly method to rollback the transaction. This will put the message back on the queue for another try later.
However, I have two questions.
- I can't find it in the spec, but I can find references to Activation Config parameters on Internet searches. For example - endpointExceptionRedeliveryAttempts. For example,
here and
here on page 356. I can't work out whether these are global across application servers (cause it is in the spec and I've missed it), specific to "Sun
Java System Message Queue", or applicable to Glassfish.
This would suggest that it was applicable to Glassfish. What I also can't work out is what I set it to if I want an unlimited number of attempts, as the default of 6 is no good (-1 seems an obvious choice but I can't find it any of the docs). A list of all of these Activation Config parameters, their acceptable values and what they do would be very helpful, but I just can't find it.
- Secondly, if I wanted a delay between attempts, is there a config value for this? For example, an attempt fails, but I want to leave it 30mins before trying again. I can put a delay in the MDB but that's not really the right place for it.
Hope someone can help,
Thanks,
MG