I guess this is a general EJB thing but it came up in the context of an MDB.
I have a simple MDB which when given an object representing an email message, interacts with our mailer to send the email.
If there are network problems or the mailer is not running I could choose to fail, but I get a retry immediately until the object ends up on the DLQ.
What I want to do is try the sendmail, if it fails sleep then try again until it works. This seems more appropriate then requeuing a message. However, Thread.sleep is bad (or so it says in the spec).
Is there any alternative?
I have a similar need (indeed just posted a similar question couched in terms of whether it is possible to suspend and resume a MDB getting called-back). Did you find a solution?