-
1. Re: Message acknowledgments in MDBs
adrian.brock Aug 31, 2005 2:56 PM (in response to timfox)CMT => transacted session => commit() => JMSXAResource.commit() => transacted ack
I'd suggest you forget about MDBs.
The MDB is implemented by the application server as is the session pool.
Your responsibility is to implement the ConnectionConsumer/Session.run() and the session level message listener.
If you really want to see how it works, enable TRACE logging as described in the user forum
and follow through an MDB message delivery from jbossmq. -
2. Re: Message acknowledgments in MDBs
ovidiu.feodorov Aug 31, 2005 4:16 PM (in response to timfox)If you really want to see how it works, enable TRACE logging as described in the user forum
and follow through an MDB message delivery from jbossmq.
I told ya Tim. You asked for it! :) -
3. Re: Message acknowledgments in MDBs
timfox Aug 31, 2005 4:17 PM (in response to timfox)Hi Adrian-
The ConnectionConsumer, Session.run and Session message listener get/set are implemented.
The problem I have is this:
1. AS starts tx
2. AS calls sessionListener.onMessage for the mdb. Call returns successfully
3. AS commits tx
4. Return controls to Session.run()
5. Message has been delivered ok so we add an ack to the tx.
6. Ooops! Exception occurs because tx was committed at step 3. There's no tx to add the ack to.
I.e. currently we are adding the ack to the transaction *after* onmessage has been called, but by then there is no active tx for the session.
I think I see the problem here: We should be adding the ack to the tx before onMessage is called. (This seems to be what JBossMQ does). And then when the AS starts a tx and enlists the session in it, any local work done in the session gets converted into work in the global tx.
Does that sound right? -
4. Re: Message acknowledgments in MDBs
adrian.brock Aug 31, 2005 5:05 PM (in response to timfox)I should add a link to this painfully long dicussion
http://www.mail-archive.com/jboss-user@lists.sourceforge.net/msg30737.html
and countless others to the FAQ.
Of course, the explanation in the spec (as far it goes) and the JBoss code
is better than any attempt I can make to "dumb it down".
Does that sound right?
JBossMQ does it that way, so suck it and see....