consolodate on a single method to handle address prefixing, resolve defect of prefixing with null
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConsumer.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConsumer.java
index 19b4560..3319297 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConsumer.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConsumer.java
@@ -35,6 +35,7 @@
import org.apache.qpid.jms.provider.AsyncResult;
import org.apache.qpid.jms.provider.ProviderConstants.ACK_TYPE;
import org.apache.qpid.jms.provider.ProviderListener;
+import org.apache.qpid.jms.provider.amqp.message.AmqpDestinationHelper;
import org.apache.qpid.jms.provider.amqp.message.AmqpJmsMessageBuilder;
import org.apache.qpid.jms.util.IOExceptionSupport;
import org.apache.qpid.proton.amqp.Binary;
@@ -138,7 +139,7 @@
@Override
protected void doOpen() {
JmsDestination destination = resource.getDestination();
- String subscription = session.getQualifiedName(destination);
+ String subscription = AmqpDestinationHelper.INSTANCE.getDestinationAddress(destination, session.getConnection());
Source source = new Source();
source.setAddress(subscription);
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpFixedProducer.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpFixedProducer.java
index 75fa850..d05824d 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpFixedProducer.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpFixedProducer.java
@@ -30,6 +30,7 @@
import org.apache.qpid.jms.message.facade.JmsMessageFacade;
import org.apache.qpid.jms.meta.JmsProducerInfo;
import org.apache.qpid.jms.provider.AsyncResult;
+import org.apache.qpid.jms.provider.amqp.message.AmqpDestinationHelper;
import org.apache.qpid.jms.provider.amqp.message.AmqpJmsMessageFacade;
import org.apache.qpid.jms.util.IOExceptionSupport;
import org.apache.qpid.proton.amqp.Binary;
@@ -238,7 +239,7 @@
if (resource.getDestination() != null) {
JmsDestination destination = resource.getDestination();
- targetAddress = session.getQualifiedName(destination);
+ targetAddress = AmqpDestinationHelper.INSTANCE.getDestinationAddress(destination, session.getConnection());
}
Symbol[] outcomes = new Symbol[]{Accepted.DESCRIPTOR_SYMBOL, Rejected.DESCRIPTOR_SYMBOL};
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpSession.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpSession.java
index d6e0abc..08c974b 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpSession.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpSession.java
@@ -215,33 +215,6 @@
}
/**
- * Adds Topic or Queue qualifiers to the destination target. We don't add qualifiers to
- * Temporary Topics and Queues since AMQP works a bit differently.
- *
- * @param destination
- * The destination to Qualify.
- *
- * @return the qualified destination name.
- */
- public String getQualifiedName(JmsDestination destination) {
- if (destination == null) {
- return null;
- }
-
- String result = destination.getName();
-
- if (!destination.isTemporary()) {
- if (destination.isTopic()) {
- result = connection.getTopicPrefix() + destination.getName();
- } else {
- result = connection.getQueuePrefix() + destination.getName();
- }
- }
-
- return result;
- }
-
- /**
* Query the Session to see if there are any registered consumer instances that have
* a durable subscription with the given subscription name.
*
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpDestinationHelper.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpDestinationHelper.java
index e3eb84a..d04e403 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpDestinationHelper.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpDestinationHelper.java
@@ -185,7 +185,7 @@
message.removeMessageAnnotation(REPLY_TO_TYPE_MSG_ANNOTATION_SYMBOL_NAME);
}
- private String getDestinationAddress(JmsDestination destination, AmqpConnection conn) {
+ public String getDestinationAddress(JmsDestination destination, AmqpConnection conn) {
if (destination == null) {
return null;
}