[jboss-user] [Messaging, JMS & JBossMQ] - Re: Message Cache configuration problem

adrian@jboss.org do-not-reply at jboss.com
Thu Mar 22 13:49:35 EDT 2007


JMS quarantees that a persistent message is either stored or you get
an error message.

The JBoss implementation looks like this (with some internal error handling removed
and comments added in block captials):


  | public class PersistentQueue extends org.jboss.mq.server.BasicQueue
  | {
  |    public void addMessage(MessageReference mesRef, Tx txId) throws JMSException
  |    {
  |       // MAKE SURE THE MESSAGE IS PERSISTED FIRST
  |       if (mesRef.isPersistent())
  |       {
  |          try
  |          {
  |             server.getPersistenceManager().add(mesRef, txId);
  |          }
  |          catch (Throwable t)
  |          {
  |             // COULDN"T PERSIST IT, SO TELL THE CLIENT IT WASN"T SENT
  |             SpyJMSException.rethrowAsJMSException(error, t);
  |          }
  |       }
  | 
  |       // NOW WE ARE SURE IT IS PERSISTED, MAKE IT AVAILABLE IN THE QUEUE
  |       super.addMessage(mesRef, txId);
  |    }
  | 

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

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



More information about the jboss-user mailing list