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.

I would be interested in hearing Sun Microsystems comments on this as
well as the vendors.  How are vendors handling this?  How does the EJB
2.0 spec team feel it should be handled?

Thanks,

Richard
--
Richard Monson-Haefel
Author of Enterprise JavaBeans, 2nd Edition  (O'Reilly 2000)
Co-Author of Java Message Service (O'Reilly 2000)
http://www.jMiddleware.com

===========================================================================
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".

Reply via email to