activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r513920 - in /activemq/trunk/activemq-core/src/main/java/org/apache/activemq: ActiveMQSession.java transport/vm/VMTransport.java
Date Fri, 02 Mar 2007 19:59:22 GMT
Author: rajdavies
Date: Fri Mar  2 11:59:21 2007
New Revision: 513920

URL: http://svn.apache.org/viewvc?view=rev&rev=513920
Log:
transports copy messages after serializing them on to the wire. So move copy on send into

the vm:// transport only

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQSession.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransport.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQSession.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQSession.java?view=diff&rev=513920&r1=513919&r2=513920
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQSession.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQSession.java Fri
Mar  2 11:59:21 2007
@@ -1585,9 +1585,6 @@
 				message.setJMSMessageID(msg.getMessageId().toString());
 			}
 			msg.setTransactionId(txid);
-			if(connection.isCopyMessageOnSend()){
-				msg=(ActiveMQMessage)msg.copy();
-			}
 			msg.setConnection(connection);
 			msg.onSend();
 			msg.setProducerId(msg.getMessageId().getProducerId());

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransport.java?view=diff&rev=513920&r1=513919&r2=513920
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransport.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransport.java
Fri Mar  2 11:59:21 2007
@@ -23,6 +23,7 @@
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.atomic.AtomicLong;
 import org.apache.activemq.command.Command;
+import org.apache.activemq.command.Message;
 import org.apache.activemq.thread.Task;
 import org.apache.activemq.thread.TaskRunner;
 import org.apache.activemq.thread.TaskRunnerFactory;
@@ -73,6 +74,9 @@
     }
 
     public void oneway(Object command) throws IOException{
+        if (command instanceof Message) {
+            command = ((Message)command).copy();
+        }
         if(disposed){
             throw new TransportDisposedIOException("Transport disposed.");
         }
@@ -90,6 +94,9 @@
     }
 
     protected void syncOneWay(Object command){
+        if (command instanceof Message) {
+            command = ((Message)command).copy();
+        }
         final TransportListener tl=peer.transportListener;
         prePeerSetQueue=peer.prePeerSetQueue;
         if(tl==null){



Mime
View raw message