diff options
Diffstat (limited to 'qpid/java/client/src/main/java/org/apache/qpid/client/AMQTopic.java')
-rw-r--r-- | qpid/java/client/src/main/java/org/apache/qpid/client/AMQTopic.java | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTopic.java b/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTopic.java index c573da9def..79624a774f 100644 --- a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTopic.java +++ b/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTopic.java @@ -147,13 +147,17 @@ public class AMQTopic extends AMQDestination implements Topic public String getTopicName() throws JMSException { - if (super.getRoutingKey() == null && super.getSubject() != null) + if (getRoutingKey() != null) { - return super.getSubject(); + return getRoutingKey().asString(); + } + else if (getSubject() != null) + { + return getSubject(); } else { - return super.getRoutingKey().toString(); + return null; } } @@ -172,12 +176,18 @@ public class AMQTopic extends AMQDestination implements Topic public AMQShortString getRoutingKey() { - if (super.getRoutingKey() == null && super.getSubject() != null) + if (super.getRoutingKey() != null) + { + return super.getRoutingKey(); + } + else if (getSubject() != null) { - return new AMQShortString(super.getSubject()); + return new AMQShortString(getSubject()); } else { + setRoutingKey(new AMQShortString("#")); + setSubject("#"); return super.getRoutingKey(); } } |