You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2011/08/25 18:19:27 UTC

svn commit: r1161627 - in /activemq/activemq-apollo/trunk: apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/ apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/dto/ apollo-website/src/documentation/

Author: chirino
Date: Thu Aug 25 16:19:27 2011
New Revision: 1161627

URL: http://svn.apache.org/viewvc?rev=1161627&view=rev
Log:
Fixes https://issues.apache.org/jira/browse/APLO-74 - Apollo does not set the timestamp header on received messages

Modified:
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/dto/StompDTO.java
    activemq/activemq-apollo/trunk/apollo-website/src/documentation/user-manual.md

Modified: activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala?rev=1161627&r1=1161626&r2=1161627&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala Thu Aug 25 16:19:27 2011
@@ -938,6 +938,10 @@ class StompProtocolHandler extends Proto
       rc ::= (MESSAGE_ID -> msgid.ascii)
     }
 
+    if( config.add_timestamp_header!=null ) {
+      rc ::= (encode_header(config.add_timestamp_header), ascii(System.currentTimeMillis().toString()))
+    }
+
     // Do we need to add the user id?
     if( host.authenticator!=null ) {
       if( config.add_user_header!=null ) {

Modified: activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/dto/StompDTO.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/dto/StompDTO.java?rev=1161627&r1=1161626&r2=1161627&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/dto/StompDTO.java (original)
+++ activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/dto/StompDTO.java Thu Aug 25 16:19:27 2011
@@ -41,6 +41,13 @@ public class StompDTO extends ProtocolDT
     @XmlElement(name="add_user_header")
     public List<AddUserHeaderDTO> add_user_headers = new ArrayList<AddUserHeaderDTO>();
 
+    /**
+     * If set, it will add the configured header name with the value
+     * set the a timestamp of when the message is recieved.
+     */
+    @XmlAttribute(name="add_timestamp_header")
+    public String add_timestamp_header;
+
     @XmlAttribute(name="max_header_length")
     public Integer max_header_length;
 

Modified: activemq/activemq-apollo/trunk/apollo-website/src/documentation/user-manual.md
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-website/src/documentation/user-manual.md?rev=1161627&r1=1161626&r2=1161627&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-website/src/documentation/user-manual.md (original)
+++ activemq/activemq-apollo/trunk/apollo-website/src/documentation/user-manual.md Thu Aug 25 16:19:27 2011
@@ -969,6 +969,10 @@ following configuration attributes:
 * `add_user_header` :  Name of the header which will be added to every received 
   message received.  The value of the header will be set to the id of user that 
   sent the message.  Not set by default.
+* `add_timestamp_header` :  Name of the header which will be added to every received 
+  message received.  The value of the header will be set to the time the message
+  was received.  The time will be represented as the number of milliseconds elapsed
+  since the UNIX epoch in GMT.  Not set by default.
 * `max_header_length` : The maximum allowed length of a STOMP header. Defaults 
   to 10240 (10k).
 * `max_headers` : The maximum number of allowed headers in a frame.  Defaults