activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r1055021 - in /activemq/trunk/activemq-core/src: main/java/org/apache/activemq/ActiveMQSession.java test/java/org/apache/activemq/JMSMessageTest.java
Date Tue, 04 Jan 2011 13:02:03 GMT
Author: gtully
Date: Tue Jan  4 13:02:03 2011
New Revision: 1055021

URL: http://svn.apache.org/viewvc?rev=1055021&view=rev
Log:
resolve: https://issues.apache.org/jira/browse/AMQ-2963 - revert setting destination on message:
https://issues.apache.org/jira/browse/AMQ-2029, just set on transformed copy as format is
provider dependent

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQSession.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JMSMessageTest.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?rev=1055021&r1=1055020&r2=1055021&view=diff
==============================================================================
--- 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 Tue
Jan  4 13:02:03 2011
@@ -1701,8 +1701,7 @@ public class ActiveMQSession implements 
             TransactionId txid = transactionContext.getTransactionId();
             long sequenceNumber = producer.getMessageSequence();
 
-            //Set the "JMS" header fields on the orriginal message, see 1.1 spec section
3.4.11
-            message.setJMSDestination(destination);
+            //Set the "JMS" header fields on the original message, see 1.1 spec section 3.4.11
             message.setJMSDeliveryMode(deliveryMode);
             long expiration = 0L;
             if (!producer.getDisableMessageTimestamp()) {
@@ -1728,7 +1727,8 @@ public class ActiveMQSession implements 
             }
             //clear the brokerPath in case we are re-sending this message
             msg.setBrokerPath(null);
-
+            // destination format is provider specific so only set on transformed message
+            msg.setJMSDestination(destination);
 
             msg.setTransactionId(txid);
             if (connection.isCopyMessageOnSend()) {

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JMSMessageTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JMSMessageTest.java?rev=1055021&r1=1055020&r2=1055021&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JMSMessageTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JMSMessageTest.java Tue
Jan  4 13:02:03 2011
@@ -47,12 +47,12 @@ import org.apache.activemq.command.Activ
 public class JMSMessageTest extends JmsTestSupport {
 
     public ActiveMQDestination destination;
-    public int deliveryMode;
+    public int deliveryMode = DeliveryMode.NON_PERSISTENT;
     public int prefetch;
     public int ackMode;
-    public byte destinationType;
+    public byte destinationType = ActiveMQDestination.QUEUE_TYPE;
     public boolean durableConsumer;
-    public String connectURL;
+    public String connectURL = "vm://localhost?marshal=false";
 
     /**
      * Run all these tests in both marshaling and non-marshaling mode.
@@ -474,7 +474,9 @@ public class JMSMessageTest extends JmsT
             //validate jms spec 1.1 section 3.4.11 table 3.1
             // JMSDestination, JMSDeliveryMode,  JMSExpiration, JMSPriority, JMSMessageID,
and JMSTimestamp
             //must be set by sending a message.
-            assertEquals(destination, message.getJMSDestination());
+
+            // exception for jms destination as the format is provider defined so it is only
set on the copy
+            assertNull(message.getJMSDestination());
             assertEquals(Session.AUTO_ACKNOWLEDGE, message.getJMSDeliveryMode());
             assertTrue(start  + timeToLive <= message.getJMSExpiration());
             assertTrue(end + timeToLive >= message.getJMSExpiration());



Mime
View raw message