qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oru...@apache.org
Subject [2/2] qpid-broker-j git commit: QPID-8060: [Broker-J] [AMQP 0-8..0-9-1] Handle unknown alternate exchange on queue declaration
Date Thu, 07 Dec 2017 10:40:07 GMT
QPID-8060: [Broker-J] [AMQP 0-8..0-9-1] Handle unknown alternate exchange on queue declaration


Project: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/commit/268f3fb6
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/268f3fb6
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/268f3fb6

Branch: refs/heads/master
Commit: 268f3fb68887208ce17987ed4d783e44073f9be8
Parents: 38c04f8
Author: Alex Rudyy <orudyy@apache.org>
Authored: Thu Dec 7 10:37:42 2017 +0000
Committer: Alex Rudyy <orudyy@apache.org>
Committed: Thu Dec 7 10:37:42 2017 +0000

----------------------------------------------------------------------
 .../java/org/apache/qpid/server/queue/AbstractQueue.java |  4 ++--
 .../server/protocol/v0_10/ServerSessionDelegate.java     |  2 +-
 .../org/apache/qpid/server/protocol/v0_8/AMQChannel.java | 11 ++++++++++-
 .../org/apache/qpid/tests/protocol/v0_8/QueueTest.java   |  1 -
 4 files changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/268f3fb6/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java b/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java
index ad40049..39584d6 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java
@@ -3534,9 +3534,9 @@ public abstract class AbstractQueue<X extends AbstractQueue<X>>
                     _virtualHost.getAttainedMessageDestination(destinationName, mayCreate);
             if (messageDestination == null)
             {
-                throw new IllegalConfigurationException(String.format(
+                throw new UnknownConfiguredObjectException(String.format(
                         "Cannot create alternate binding for '%s' : Alternate binding destination
'%s' cannot be found.",
-                        getName(), destinationName));
+                        getName(), destinationName), ConfiguredObject.class, destinationName);
             }
             else if (messageDestination == this)
             {

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/268f3fb6/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSessionDelegate.java
----------------------------------------------------------------------
diff --git a/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSessionDelegate.java
b/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSessionDelegate.java
index 9fd9b52..ccaee39 100644
--- a/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSessionDelegate.java
+++ b/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSessionDelegate.java
@@ -1603,7 +1603,7 @@ public class ServerSessionDelegate extends MethodDelegate<ServerSession>
impleme
             {
                 exception(session, method, ExecutionErrorCode.UNAUTHORIZED_ACCESS, e.getMessage());
             }
-            catch (IllegalConfigurationException e)
+            catch (IllegalArgumentException | IllegalConfigurationException e)
             {
                 exception(session, method, ExecutionErrorCode.ILLEGAL_ARGUMENT, e.getMessage());
             }

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/268f3fb6/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java
----------------------------------------------------------------------
diff --git a/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java
b/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java
index 5eef253..07d0f91 100644
--- a/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java
+++ b/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java
@@ -3126,7 +3126,16 @@ public class AMQChannel extends AbstractAMQPSession<AMQChannel,
ConsumerTarget_0
             {
                 _connection.sendConnectionClose(ErrorCodes.ACCESS_REFUSED, e.getMessage(),
getChannelId());
             }
-
+            catch (UnknownConfiguredObjectException e)
+            {
+                final String message = String.format("Unknown alternate exchange: '%s'",
e.getName());
+                _connection.sendConnectionClose(ErrorCodes.NOT_FOUND, message, getChannelId());
+            }
+            catch (IllegalArgumentException | IllegalConfigurationException e)
+            {
+                String message = String.format("Error creating queue '%s': %s", queueName,
e.getMessage());
+                _connection.sendConnectionClose(ErrorCodes.COMMAND_INVALID, message, getChannelId());
+            }
         }
     }
 

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/268f3fb6/systests/protocol-tests-amqp-0-8/src/test/java/org/apache/qpid/tests/protocol/v0_8/QueueTest.java
----------------------------------------------------------------------
diff --git a/systests/protocol-tests-amqp-0-8/src/test/java/org/apache/qpid/tests/protocol/v0_8/QueueTest.java
b/systests/protocol-tests-amqp-0-8/src/test/java/org/apache/qpid/tests/protocol/v0_8/QueueTest.java
index ac7e72c..5657c85 100644
--- a/systests/protocol-tests-amqp-0-8/src/test/java/org/apache/qpid/tests/protocol/v0_8/QueueTest.java
+++ b/systests/protocol-tests-amqp-0-8/src/test/java/org/apache/qpid/tests/protocol/v0_8/QueueTest.java
@@ -734,7 +734,6 @@ public class QueueTest extends BrokerAdminUsingTestBase
 
     /** Qpid specific extension */
     @Test
-    @Ignore("TODO - server fails if queue is declared with unknown alternate exchange")
     public void queueDeclareWithUnknownAlternateExchange() throws Exception
     {
         try(FrameTransport transport = new FrameTransport(_brokerAddress).connect())


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message