3 Replies Latest reply on Jul 21, 2009 11:06 AM by timfox

    Moving Messages Twice and LargeMessage links

    clebert.suconic

      I have https://jira.jboss.org/jira/browse/JBMESSAGING-1496 complete at my local box, but there is one small detail I need to figure out.

      I'm using _JBM_ORIG_MESSAGE_ID to link the Message to the original file. This way instead of copying the file I just use the original file, and I' m just making sure reference counting is working properly with this.

      However, when you move messages twice (say... first ExpiryQueue, then DLA), the ORIG_MESSAGE_ID won' t be pointing to the original message any more.


      Because of that, I changed the method makeCopy:

      ServerMessage copy = message.copy(newMessageId);
      
       if (ref.getMessage().getProperty(HDR_ORIG_MESSAGE_ID) != null)
       {
       copy.putStringProperty(HDR_ORIGINAL_DESTINATION, (SimpleString)ref.getMessage()
       .getProperty(HDR_ORIGINAL_DESTINATION));
       copy.putLongProperty(HDR_ORIG_MESSAGE_ID, (Long)ref.getMessage().getProperty(HDR_ORIG_MESSAGE_ID));
       }
       else
       {
       SimpleString originalQueue = copy.getDestination();
       copy.putStringProperty(HDR_ORIGINAL_DESTINATION, originalQueue);
       copy.putLongProperty(HDR_ORIG_MESSAGE_ID, message.getMessageID());
       }
      



      which is what I would expect as the semantic of Original Message.

      If someone has a different expectation for this, I will just create a different property.

      It' s a very minimal change and I could do it either way.