qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raj...@apache.org
Subject svn commit: r1061577 - in /qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message: AMQMessageDelegate_0_10.java AbstractAMQMessageDelegate.java
Date Thu, 20 Jan 2011 23:51:09 GMT
Author: rajith
Date: Thu Jan 20 23:51:09 2011
New Revision: 1061577

URL: http://svn.apache.org/viewvc?rev=1061577&view=rev
Log:
QPID-3011
Commiting a fix as per the solution outlined in the above JIRA.
A null check is added in the generateDestination method in AbstractAMQMessageDelegate.java
where an ExchangeInfo object is created with just the exchange name to allow the destination
to be created. The correct information will be querried when a consumer or producer is created
with that destination.

If a replyTo address is available then the exchange info for that is querried and updated
within the updateExchangeTypeMapping method in AMQMessageDelegate_0_10.java

Modified:
    qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java
    qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/AbstractAMQMessageDelegate.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=1061577&r1=1061576&r2=1061577&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 20 23:51:09 2011
@@ -115,15 +115,28 @@ public class AMQMessageDelegate_0_10 ext
         if (deliveryProps != null)
         {
             String exchange = deliveryProps.getExchange();
+            checkAndUpdateExchange(exchange,session);
+                    
+        }
+        
+        MessageProperties msgProps = header.get(MessageProperties.class);
+        if (msgProps != null && msgProps.getReplyTo() != null)
+        {
+            String exchange = msgProps.getReplyTo().getExchange();
+            checkAndUpdateExchange(exchange,session);
+                    
+        }
+    }
+    
+    private static void checkAndUpdateExchange(String exchange, org.apache.qpid.transport.Session
session)
+    {
+        if (exchange != null && !exchangeMapContains(exchange))
+        {
+            Future<ExchangeQueryResult> future =
+                    session.exchangeQuery(exchange.toString());
+            ExchangeQueryResult res = future.get();
 
-            if (exchange != null && !exchangeMapContains(exchange))
-            {
-                Future<ExchangeQueryResult> future =
-                        session.exchangeQuery(exchange.toString());
-                ExchangeQueryResult res = future.get();
-
-                updateExchangeType(exchange, res.getType());
-            }
+            updateExchangeType(exchange, res.getType());
         }
     }
 

Modified: qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/AbstractAMQMessageDelegate.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/AbstractAMQMessageDelegate.java?rev=1061577&r1=1061576&r2=1061577&view=diff
==============================================================================
--- qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/AbstractAMQMessageDelegate.java
(original)
+++ qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/AbstractAMQMessageDelegate.java
Thu Jan 20 23:51:09 2011
@@ -95,6 +95,11 @@ public abstract class AbstractAMQMessage
         AMQDestination dest;
         ExchangeInfo exchangeInfo = _exchangeMap.get(exchange.asString());
         
+        if (exchangeInfo == null)
+        {
+            exchangeInfo = new ExchangeInfo(exchange.asString(),"",AMQDestination.UNKNOWN_TYPE);
+        }
+        
         if ("topic".equals(exchangeInfo.exchangeType))
         {
             dest = new AMQTopic(exchange, routingKey, null);



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


Mime
View raw message