[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Re: Branch 1_0_XARecovery

timfox do-not-reply at jboss.com
Sat Dec 2 10:10:46 EST 2006


"juha at jboss.org" wrote : "timfox" wrote : 
  |   | 1) The call to persistenceManager.associateTxCallbackToPreparedTx() in TransactionRepository::loadPreparedTransactions()
  |   | 
  |   | seems to be redundant since the callback will be automatically created when the refs / acks are replayed.
  |   | 
  | 
  | However, removing it will cause the recovery to fail (messages are not delivered).
  | 
  | 

Should definitely be redundant. If stuff fails when it's removed, then that points to another problem.

"Juha" wrote : 
  | Right. I was suspecting this based on the API but couldn't find any clear indication of this in the code.
  | 

What you want to do is basically this:

for the acks:

select message_id from jms_message_reference where transaction_id=? and state ="+"

this gives you all the message ids you want to load

then call persistenceManager.getMessages(List ids) to get the actual messages for those ids.

Then call messageStore.reference(Message m) for each of those messages - this will give you a reference for each of the messages.

Once you have your references you can call channel.handle(ref, tx) to replay them through the channel.

(This will create any callbacks).

A similar procedure applies for acks, except the query to get them is different:

select message_id from jms_message_reference where transaction_id=? and state ="-"



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3990753#3990753

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3990753



More information about the jboss-dev-forums mailing list