diff options
author | Rajith Muditha Attapattu <rajith@apache.org> | 2012-01-26 19:24:29 +0000 |
---|---|---|
committer | Rajith Muditha Attapattu <rajith@apache.org> | 2012-01-26 19:24:29 +0000 |
commit | 3425e55d2652d650118db7848390050a15ceebe4 (patch) | |
tree | 7460aab7478c0007b9a1869c7ed1c8853174ac17 /java/client | |
parent | fb6c7b1608fe104a5f34016923814d225775e9fb (diff) | |
download | qpid-python-3425e55d2652d650118db7848390050a15ceebe4.tar.gz |
QPID-3786 Setting queueName, exchange and routingKey from information
given in the incomming message.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1236355 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/client')
-rw-r--r-- | java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java b/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java index 179ebd66d1..c72212bfe2 100644 --- a/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java +++ b/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java @@ -271,6 +271,7 @@ public class AMQMessageDelegate_0_10 extends AbstractAMQMessageDelegate 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 extends AbstractAMQMessageDelegate 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) { |