qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raj...@apache.org
Subject svn commit: r1236355 - /qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java
Date Thu, 26 Jan 2012 19:24:29 GMT
Author: rajith
Date: Thu Jan 26 19:24:29 2012
New Revision: 1236355

URL: http://svn.apache.org/viewvc?rev=1236355&view=rev
Log:
QPID-3786 Setting queueName, exchange and routingKey from information
given in the incomming message.

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=1236355&r1=1236354&r2=1236355&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
Thu Jan 26 19:24:29 2012
@@ -271,6 +271,7 @@ public class AMQMessageDelegate_0_10 ext
     private Destination convertToAddressBasedDestination(String exchange, String routingKey,
String subject)
     {
         String addr;
+        boolean isQueue = true;
         if ("".equals(exchange)) // type Queue
         {
             subject = (subject == null) ? "" : "/" + subject;
@@ -279,11 +280,24 @@ public class AMQMessageDelegate_0_10 ext
         else
         {
             addr = exchange + "/" + routingKey;
+            isQueue = false;
         }
         
         try
         {
-            return AMQDestination.createDestination("ADDR:" + addr);
+            AMQDestination dest = (AMQDestination)AMQDestination.createDestination("ADDR:"
+ addr);
+            if (isQueue)
+            {
+                dest.setQueueName(new AMQShortString(routingKey));
+                dest.setRoutingKey(new AMQShortString(routingKey));
+                dest.setExchangeName(new AMQShortString(""));
+            }
+            else
+            {
+                dest.setRoutingKey(new AMQShortString(routingKey));
+                dest.setExchangeName(new AMQShortString(exchange));
+            }
+            return dest;
         }
         catch(Exception e)
         {



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message