activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dej...@apache.org
Subject svn commit: r1060871 - in /activemq/trunk/activemq-core/src: main/java/org/apache/activemq/transport/stomp/FrameTranslator.java main/java/org/apache/activemq/transport/stomp/Stomp.java test/java/org/apache/activemq/transport/stomp/StompTest.java
Date Wed, 19 Jan 2011 17:15:38 GMT
Author: dejanb
Date: Wed Jan 19 17:15:38 2011
New Revision: 1060871

URL: http://svn.apache.org/viewvc?rev=1060871&view=rev
Log:
https://issues.apache.org/jira/browse/AMQ-3146 - original destination from stomp

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/FrameTranslator.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/Stomp.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompTest.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/FrameTranslator.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/FrameTranslator.java?rev=1060871&r1=1060870&r2=1060871&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/FrameTranslator.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/FrameTranslator.java
Wed Jan 19 17:15:38 2011
@@ -77,6 +77,10 @@ public interface FrameTranslator {
             if (message.getUserID() != null) {
                 headers.put(Stomp.Headers.Message.USERID, message.getUserID());
             }
+
+            if (message.getOriginalDestination() != null) {
+                headers.put(Stomp.Headers.Message.ORIGINAL_DESTINATION, ft.convertDestination(converter,
message.getOriginalDestination()));
+            }
             
             // now lets add all the message headers
             final Map<String, Object> properties = message.getProperties();

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/Stomp.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/Stomp.java?rev=1060871&r1=1060870&r2=1060871&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/Stomp.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/Stomp.java
Wed Jan 19 17:15:38 2011
@@ -82,6 +82,7 @@ public interface Stomp {
             String TYPE = "type";
             String SUBSCRIPTION = "subscription";
             String USERID = "JMSXUserID";
+            String ORIGINAL_DESTINATION = "original-destination";
         }
 
         public interface Subscribe {

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompTest.java?rev=1060871&r1=1060870&r2=1060871&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompTest.java
Wed Jan 19 17:15:38 2011
@@ -1408,6 +1408,25 @@ public class StompTest extends Combinati
 
     }
 
+    public void testExpire() throws Exception {
+        stompConnection.connect("system", "manager");
+
+        HashMap<String, String> headers = new HashMap<String, String>();
+        long timestamp = System.currentTimeMillis();
+        headers.put(Stomp.Headers.Message.EXPIRATION_TIME, String.valueOf(timestamp));
+        headers.put(Stomp.Headers.Send.PERSISTENT, "true");
+
+
+        stompConnection.send("/queue/" + getQueueName(), "msg", null, headers);
+
+        stompConnection.subscribe("/queue/ActiveMQ.DLQ");
+        StompFrame stompMessage = stompConnection.receive(1000);
+        assertNotNull(stompMessage);
+        assertEquals(stompMessage.getHeaders().get(Stomp.Headers.Message.ORIGINAL_DESTINATION),
"/queue/" + getQueueName());
+    }
+
+
+
 
     protected void assertClients(int expected) throws Exception {
         org.apache.activemq.broker.Connection[] clients = broker.getBroker().getClients();



Mime
View raw message