Repository: camel
Updated Branches:
  refs/heads/master c56a48433 -> d66797ba8


CAMEL-8270 exchangeName in the URI is optional


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/d66797ba
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/d66797ba
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/d66797ba

Branch: refs/heads/master
Commit: d66797ba8e25bf5d5db5a5d2b193678f5770b6d8
Parents: c56a484
Author: Willem Jiang <[email protected]>
Authored: Thu Apr 30 14:40:00 2015 +0800
Committer: Willem Jiang <[email protected]>
Committed: Thu Apr 30 14:40:23 2015 +0800

----------------------------------------------------------------------
 .../org/apache/camel/component/rabbitmq/RabbitMQComponent.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/d66797ba/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQComponent.java
----------------------------------------------------------------------
diff --git 
a/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQComponent.java
 
b/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQComponent.java
index 5f97f49..54dd2bf 100644
--- 
a/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQComponent.java
+++ 
b/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQComponent.java
@@ -45,10 +45,10 @@ public class RabbitMQComponent extends UriEndpointComponent 
{
         URI host = new URI("http://"; + remaining);
         String hostname = host.getHost();
         int portNumber = host.getPort();
-        if (host.getPath().trim().length() <= 1) {
-            throw new IllegalArgumentException("No URI path as the 
exchangeName for the RabbitMQEndpoint, the URI is " + uri);
+        String exchangeName = ""; // We need to support the exchange to be "" 
the path is empty
+        if (host.getPath().trim().length() > 1) {
+            exchangeName = host.getPath().substring(1);
         }
-        String exchangeName = host.getPath().substring(1);
 
         // ConnectionFactory reference
         ConnectionFactory connectionFactory = 
resolveAndRemoveReferenceParameter(params, "connectionFactory", 
ConnectionFactory.class);

Reply via email to