Hmmmm, I've got the basic framework down. If RemoteDeliveryMDB can't send to some of the recipients it throws an EJBException causing it to retry. After the max number of retries it gets placed on an alternative DLQ with another MDB at the end of it, which is all well and good.
The problem with this way of doing it is with how MailQueueReceiverMDB/SMTPSender works. If the Mail in the ObjectMessage originally has 10 recipients and say five of them fail (and five worked), the message is retried and will have all the original ten recipients there, so if the message gets retried five times using JMS the five recipients who receive the message will receive multiple copies of the message. There is no obvious way of keeping track of who has been sent to. I've tried modifying the Mail object and setting it in the ObjectMessage before throwing my exception, but as expected that didn't work (if I rememebr correctly the message is cloned somewhere in the container/interceptor stack). Also, I'm not sure if there is any way to delay retries: http://www.jboss.org/index.html?module=bb&op=viewtopic&t=30516 Suggestions please! I could well be missing something, so if anybody knows a way around the problem described above I'm all ears. Another way of doing it though, might be to make the queued ObjectMessage contain a MailWrapper object which contains the Mail object. The wrapper could contain a variable containing the mail object, and the number of tries and the recipients successfully sent to so far. If RemoteDeliveryMDB can not send the message to ALL recipients it increments the number of tries and updates the successful recpient list in the wrapper, and places it in a new ObjectMessage on the offServer queue itself. That way it could also set the JMS_JBOSS_REDELIVERY_DELAY property as well to allow for delay. Once it receives a wrapper with a number of retries greater than the maximum number of retries it can throw an Exception so the message is placed on the DLQ (in which case the max number. An added bonus is that we would be able to specify a different retry interval for each retry, so that we could do it more frequently the first few times. If somebody knows a way around the problem mentioned above this should not be necessary. Cheers, Kab View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3832489#3832489 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3832489 ------------------------------------------------------- This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek For a limited time only, get FREE Ground shipping on all orders of $35 or more. Hurry up and shop folks, this offer expires April 30th! http://www.thinkgeek.com/freeshipping/?cpg297 _______________________________________________ JBoss-Development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
