summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorRobert Godfrey <rgodfrey@apache.org>2008-01-03 14:24:34 +0000
committerRobert Godfrey <rgodfrey@apache.org>2008-01-03 14:24:34 +0000
commitfdd5322d33d988518ec7e232ba81229cdf4679ec (patch)
treed1cb1ddeebce958f7a702c49923a0a5230d2a1d0 /java
parent8a916973a6a6209d49af5363b10d3b29af2b151f (diff)
downloadqpid-python-fdd5322d33d988518ec7e232ba81229cdf4679ec.tar.gz
QPID-716 : pass in generated Queue Name
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/M2.1@608497 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/handler/QueueDeclareHandler.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/java/broker/src/main/java/org/apache/qpid/server/handler/QueueDeclareHandler.java b/java/broker/src/main/java/org/apache/qpid/server/handler/QueueDeclareHandler.java
index f59fcf2a12..067c6ac285 100644
--- a/java/broker/src/main/java/org/apache/qpid/server/handler/QueueDeclareHandler.java
+++ b/java/broker/src/main/java/org/apache/qpid/server/handler/QueueDeclareHandler.java
@@ -82,7 +82,7 @@ public class QueueDeclareHandler implements StateAwareMethodListener<QueueDeclar
// if we aren't given a queue name, we create one which we return to the client
- if (body.getQueue() == null)
+ if ((body.getQueue() == null) || (body.getQueue().length() == 0))
{
queueName = createName();
}
@@ -109,7 +109,7 @@ public class QueueDeclareHandler implements StateAwareMethodListener<QueueDeclar
}
else
{
- queue = createQueue(body, virtualHost, session);
+ queue = createQueue(queueName,body, virtualHost, session);
if (queue.isDurable() && !queue.isAutoDelete())
{
store.createQueue(queue);
@@ -161,13 +161,16 @@ public class QueueDeclareHandler implements StateAwareMethodListener<QueueDeclar
return new AMQShortString("tmp_" + UUID.randomUUID());
}
- protected AMQQueue createQueue(QueueDeclareBody body, VirtualHost virtualHost, final AMQProtocolSession session)
+ protected AMQQueue createQueue(final AMQShortString queueName,
+ QueueDeclareBody body,
+ VirtualHost virtualHost,
+ final AMQProtocolSession session)
throws AMQException
{
final QueueRegistry registry = virtualHost.getQueueRegistry();
AMQShortString owner = body.getExclusive() ? session.getContextKey() : null;
- final AMQQueue queue = new AMQQueue(body.getQueue(), body.getDurable(), owner, body.getAutoDelete(), virtualHost);
- final AMQShortString queueName = queue.getName();
+ final AMQQueue queue = new AMQQueue(queueName, body.getDurable(), owner, body.getAutoDelete(), virtualHost);
+
if (body.getExclusive() && !body.getDurable())
{