[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Moving Messages Twice and LargeMessage links

clebert.suconic@jboss.com do-not-reply at jboss.com
Mon Jul 20 19:36:50 EDT 2009


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.

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

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



More information about the jboss-dev-forums mailing list