[jboss-cvs] JBoss Messaging SVN: r3517 - trunk/src/main/org/jboss/jms/client/container.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Dec 18 11:56:43 EST 2007


Author: timfox
Date: 2007-12-18 11:56:43 -0500 (Tue, 18 Dec 2007)
New Revision: 3517

Modified:
   trunk/src/main/org/jboss/jms/client/container/ProducerAspect.java
Log:
Fixed comod exception due to copying message


Modified: trunk/src/main/org/jboss/jms/client/container/ProducerAspect.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/container/ProducerAspect.java	2007-12-17 17:17:36 UTC (rev 3516)
+++ trunk/src/main/org/jboss/jms/client/container/ProducerAspect.java	2007-12-18 16:56:43 UTC (rev 3517)
@@ -250,19 +250,22 @@
       org.jboss.messaging.newcore.Destination coreDest =
          new DestinationImpl(dest.isQueue() ? "Queue" : "Topic", dest.getName(), dest.isTemporary());
       
+      org.jboss.messaging.newcore.Message messageToSend = jbm.getCoreMessage();
+      
       //FIXME - temp - for now we set destination as a header - should really be an attribute of the 
       //send packet - along with scheduleddelivery time
       
-      jbm.getCoreMessage().putHeader(org.jboss.messaging.newcore.Message.TEMP_DEST_HEADER_NAME, coreDest);
+      messageToSend.putHeader(org.jboss.messaging.newcore.Message.TEMP_DEST_HEADER_NAME, coreDest);
 
-      // we now invoke the send(Message) method on the session, which will eventually be fielded
-      // by connection endpoint
-      ((SessionDelegate)sessionState.getDelegate()).send(jbm.getCoreMessage(), false);
-      
+      //We copy *before* sending
       //TODO for now we always copy - for INVM we can optimise (like we did in 1.4) by doing lazy copying
       //of message, header and properties
       jbm.copyMessage();
       
+      // we now invoke the send(Message) method on the session, which will eventually be fielded
+      // by connection endpoint
+      ((SessionDelegate)sessionState.getDelegate()).send(messageToSend, false);
+                  
       return null;
    }
    




More information about the jboss-cvs-commits mailing list