-
1. Re: MessageDriven Bean Redelivery Fails
mikelarnett Oct 7, 2003 10:48 AM (in response to mikelarnett)Also, I never see the QueueDepth Change from 0 to 1...
-
2. Re: MessageDriven Bean Redelivery Fails
adrian.brock Oct 7, 2003 5:33 PM (in response to mikelarnett)For the 256th factorial time!
MDBs do not acknowledge messages
(at least not directly).
It is also an error to leak
Exceptions from onMessage()
onMessage is part of the JMS spec.
If you want to the talk to the MDB use the
MessageDrivenContext.
You should configure your onMessage to run inside
a transaction then code something like:
MessageDrivenContext ctx;
public void setMessageDrivenContext(MessageDrivenContext ctx)
{
this.ctx = ctx;
}
public void onMessage(Message m)
{
try
{
doSomething(m);
}
catch (ExpectedException e)
{
handleExpected(e);
}
catch (Throwable e)
{
log.warn("Error occurred", e);
ctx.setRollbackOnly();
}
This is the only time I'm going to post this -
this month :-)
Regards,
Adrian -
3. Belated thanks Adrian...
mikelarnett Nov 18, 2003 2:17 PM (in response to mikelarnett)It was helpful, even if it was recycled :)
-MLA