diff options
author | Rajith Muditha Attapattu <rajith@apache.org> | 2011-10-14 22:29:03 +0000 |
---|---|---|
committer | Rajith Muditha Attapattu <rajith@apache.org> | 2011-10-14 22:29:03 +0000 |
commit | 390b6b48b9808a1862b48b3e324451b95f465ed4 (patch) | |
tree | 8190d53d1c3d3022690be7a0b39dd848331a74e0 /java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java | |
parent | c77eff7738c4bd8424fd2205788a3f34ace13df5 (diff) | |
download | qpid-python-address-refactor.tar.gz |
QPID-3401 Checking the proposed changes into a branch to preserve history & continue working until such time it's accepted into trunk.address-refactor
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/address-refactor@1183532 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java')
-rw-r--r-- | java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java | 38 |
1 files changed, 9 insertions, 29 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 f360b546b2..c6c36b9afe 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 @@ -42,6 +42,7 @@ import org.apache.qpid.AMQException; import org.apache.qpid.AMQPInvalidClassException; import org.apache.qpid.client.AMQDestination; import org.apache.qpid.client.AMQSession_0_10; +import org.apache.qpid.client.AddressBasedDestination; import org.apache.qpid.client.CustomJMSXProperty; import org.apache.qpid.framing.AMQShortString; import org.apache.qpid.jms.Message; @@ -271,13 +272,14 @@ public class AMQMessageDelegate_0_10 extends AbstractAMQMessageDelegate private Destination convertToAddressBasedDestination(String exchange, String routingKey, String subject) { String addr; - if ("".equals(exchange)) // type Queue + if ("".equals(exchange)) // type Queue and the routing key is the Queue name. { subject = (subject == null) ? "" : "/" + subject; addr = routingKey + subject; } else { + // routing key is the subject here. addr = exchange + "/" + routingKey; } @@ -315,36 +317,14 @@ public class AMQMessageDelegate_0_10 extends AbstractAMQMessageDelegate if (amqd.getDestSyntax() == AMQDestination.DestSyntax.ADDR) { - try - { - int type = ((AMQSession_0_10)getAMQSession()).resolveAddressType(amqd); - if (type == AMQDestination.QUEUE_TYPE) - { - ((AMQSession_0_10)getAMQSession()).setLegacyFiledsForQueueType(amqd); - } - else - { - ((AMQSession_0_10)getAMQSession()).setLegacyFiledsForTopicType(amqd); - } - } - catch(AMQException ex) - { - JMSException e = new JMSException("Error occured while figuring out the node type"); - e.initCause(ex); - e.setLinkedException(ex); - throw e; - } - catch (TransportException e) - { - JMSException jmse = new JMSException("Exception occured while figuring out the node type:" + e.getMessage()); - jmse.initCause(e); - jmse.setLinkedException(e); - throw jmse; - } - + AddressBasedDestination dest = (AddressBasedDestination)amqd; + dest.resolveAddress((AMQSession_0_10)_session); } - final ReplyTo replyTo = new ReplyTo(amqd.getExchangeName().toString(), amqd.getRoutingKey().toString()); + String exchangeName = amqd.getExchangeName().asString(); + String routingKey = amqd.getRoutingKey().asString(); + + final ReplyTo replyTo = new ReplyTo(exchangeName, routingKey); _destinationCache.put(replyTo, new SoftReference<Destination>(destination)); _messageProps.setReplyTo(replyTo); |