You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kw...@apache.org on 2018/01/09 15:40:00 UTC

[3/6] qpid-broker-j git commit: QPID-8060: [Broker-J] [AMQP 0-8..0-9-1] Handle unknown alternate exchange on queue declaration

QPID-8060: [Broker-J] [AMQP 0-8..0-9-1] Handle unknown alternate exchange on queue declaration

Cherry picked from master 268f3fb


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/ce345a7b
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/ce345a7b
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/ce345a7b

Branch: refs/heads/7.0.x
Commit: ce345a7bb08a2c257155583e11055d1935db1e3d
Parents: 43edc06
Author: Alex Rudyy <or...@apache.org>
Authored: Thu Dec 7 10:37:42 2017 +0000
Committer: Keith Wall <kw...@apache.org>
Committed: Tue Jan 9 14:54:32 2018 +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 ++++++++++-
 3 files changed, 13 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/ce345a7b/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/ce345a7b/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/ce345a7b/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());
+            }
         }
     }
 


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