Richard Monson-Haefel wrote:
>
> The EJB 2.0 specification doesn't say when a message is acknowledge with
> Auto-acknowledgment in BMT message-driven beans (MDB). This is somewhat
> understandable since JMS itself is somewhat ambiguous about the exact
> timing of AUTO_ACKNOWLEDGMENT mode. However, it makes a big difference
> in EJB 2.0 if the message is acknowledged before the message is
> delegated to the MDB instance or after. With Auto-acknowledgment, I
> would make the assumption that the message is acknowledged before
> delegating the message to the client, or shortly there after regardless
> of the out come of the onMessage() method (normal return vs. exception
> thrown).
>
> It would be better, however, if it occurred after the successful
> completion of the onMessage() method to allow redelivery of the message
> in the advent of a failure while handling the message. In other words,
> if the MDB throws an exception from the onMessage() method, the receipt
> of the message should not be acknowledged by the EJB container. In BMT
> MDB where message acknowledgment is not a part of the transaction commit
> processes, a failure to acknowledge the message would allow it to be
> redelivered and not lost. This is also true of container-managed
> transactions where the transaction attribute is NotSupported. This is
> something that should be clarified in the specification or at least
> addressed.
Richard,
I think you are muddling two concepts here, "acknowledgement", and "guaranteed
delivery".
An acknowledgement is an encouraging information mesage - no more. It's a bit
like an email from Amazon saying your book order was delivered to your favorite
aunt.
Guaranteed delivery is a messaging feature that means that the message will not
be lost. It uses safe store and forward techniques to get the message to the
target application and transaction processing to ensure the message is processed
once only. Poisoned messages are a difficulty with guaranteed delivery. A
poisoned message is one that causes the application to rollback each time it is
retried. Typically messages are retried a few times then put to one side for
examination by people rather than programs.
You should not try to implement your own guaranteed delivery by using lack of an
acknowledgement as a trigger to resend the message, just as you should not
resubmit your book order just because you have not received an email from Amazon
by the time of your aunt's birthday!
cheers... Ian
========================================
Ian McCallion
Alexis Systems Limited
Romsey, UK
Tel: +44 1794 514883
Fax: +44 1794 501692
========================================
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".