qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raj...@apache.org
Subject svn commit: r1442364 - /qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java
Date Mon, 04 Feb 2013 21:13:37 GMT
Author: rajith
Date: Mon Feb  4 21:13:37 2013
New Revision: 1442364

URL: http://svn.apache.org/viewvc?rev=1442364&view=rev
Log:
QPID-4566 Allow a non UUID String to be set as message-id. This is
required when Qpid Messages are sent using a 3rd party JMS Message
Producer. Ex a Message Bridge. This doesn't
affect AMQP 0-10 compliance as the sender implementation will always
assign an UUID string as the message-id.

Modified:
    qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java

Modified: qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java?rev=1442364&r1=1442363&r2=1442364&view=diff
==============================================================================
--- qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java
(original)
+++ qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java
Mon Feb  4 21:13:37 2013
@@ -91,6 +91,7 @@ public class AMQMessageDelegate_0_10 ext
 
     private MessageProperties _messageProps;
     private DeliveryProperties _deliveryProps;
+    private String _messageID;
 
     protected AMQMessageDelegate_0_10()
     {
@@ -171,8 +172,12 @@ public class AMQMessageDelegate_0_10 ext
 
     public String getJMSMessageID() throws JMSException
     {
-        UUID id = _messageProps.getMessageId();
-        return id == null ? null : "ID:" + id;
+        if (_messageID == null && _messageProps.getMessageId() != null)
+        {
+            UUID id = _messageProps.getMessageId();
+            _messageID = "ID:" + id;
+        }
+        return _messageID;
     }
 
     public void setJMSMessageID(String messageId) throws JMSException
@@ -185,14 +190,7 @@ public class AMQMessageDelegate_0_10 ext
         {
             if(messageId.startsWith("ID:"))
             {
-                try
-                {
-                    _messageProps.setMessageId(UUID.fromString(messageId.substring(3)));
-                }
-                catch(IllegalArgumentException ex)
-                {
-                    throw new JMSException("MessageId '"+messageId+"' is not of the correct
format, it must be ID: followed by a UUID");
-                }
+                _messageID = messageId;
             }
             else
             {
@@ -201,6 +199,7 @@ public class AMQMessageDelegate_0_10 ext
         }
     }
 
+    /* Used by the internal implementation */
     public void setJMSMessageID(UUID messageId) throws JMSException
     {
         if(messageId == null)



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message