You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2015/09/24 11:05:13 UTC

[1/4] camel git commit: CAMEL-9156: Add JMX api for the swagger api

Repository: camel
Updated Branches:
  refs/heads/master 6dc937a00 -> 3ba805987


CAMEL-9156: Add JMX api for the swagger api


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

Branch: refs/heads/master
Commit: 35b59f1370781d858d7a0c468d5a8482055c2107
Parents: 6dc937a
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Sep 24 10:11:14 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Sep 24 10:11:14 2015 +0200

----------------------------------------------------------------------
 .../mbean/ManagedRestRegistryMBean.java         |  3 ++
 .../management/mbean/ManagedRestRegistry.java   | 40 ++++++++++++++++++++
 .../management/ManagedRestRegistryTest.java     |  4 ++
 3 files changed, 47 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/35b59f13/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedRestRegistryMBean.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedRestRegistryMBean.java b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedRestRegistryMBean.java
index 804d294..1153b40 100644
--- a/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedRestRegistryMBean.java
+++ b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedRestRegistryMBean.java
@@ -29,4 +29,7 @@ public interface ManagedRestRegistryMBean extends ManagedServiceMBean {
     @ManagedOperation(description = "Lists all the Rest services in the registry (url, path, verb, consumes, produces)")
     TabularData listRestServices();
 
+    @ManagedOperation(description = "Outputs the Rest services API documentation in JSon (requires camel-swagger-java on classpath)")
+    String apiDocAsJson();
+
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/35b59f13/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRestRegistry.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRestRegistry.java b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRestRegistry.java
index 244182e..e9e5f7c 100644
--- a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRestRegistry.java
+++ b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRestRegistry.java
@@ -17,6 +17,7 @@
 package org.apache.camel.management.mbean;
 
 import java.util.List;
+import java.util.Map;
 import javax.management.openmbean.CompositeData;
 import javax.management.openmbean.CompositeDataSupport;
 import javax.management.openmbean.CompositeType;
@@ -24,11 +25,15 @@ import javax.management.openmbean.TabularData;
 import javax.management.openmbean.TabularDataSupport;
 
 import org.apache.camel.CamelContext;
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.Producer;
 import org.apache.camel.api.management.ManagedResource;
 import org.apache.camel.api.management.mbean.CamelOpenMBeanTypes;
 import org.apache.camel.api.management.mbean.ManagedRestRegistryMBean;
 import org.apache.camel.spi.RestRegistry;
 import org.apache.camel.util.ObjectHelper;
+import org.apache.camel.util.ServiceHelper;
 
 /**
  *
@@ -82,4 +87,39 @@ public class ManagedRestRegistry extends ManagedService implements ManagedRestRe
             throw ObjectHelper.wrapRuntimeCamelException(e);
         }
     }
+
+    @Override
+    public String apiDocAsJson() {
+        // see if there is a rest-api endpoint which would be the case if rest api-doc has been explicit enabled
+        Endpoint found = null;
+        for (Map.Entry<String, Endpoint> entry : getContext().getEndpointMap().entrySet()) {
+            String uri = entry.getKey();
+            if (uri.startsWith("rest-api")) {
+                found = entry.getValue();
+                break;
+            }
+        }
+
+        try {
+            if (found != null) {
+                Producer producer = found.createProducer();
+                ServiceHelper.startService(producer);
+
+                try {
+                    Exchange dummy = found.createExchange();
+                    producer.process(dummy);
+
+                    String json = dummy.hasOut() ? dummy.getOut().getBody(String.class) : dummy.getIn().getBody(String.class);
+                    return json;
+                } finally {
+                    ServiceHelper.stopService(producer);
+                }
+            }
+        } catch (Exception e) {
+            throw ObjectHelper.wrapRuntimeCamelException(e);
+        }
+
+        return null;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/35b59f13/camel-core/src/test/java/org/apache/camel/management/ManagedRestRegistryTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedRestRegistryTest.java b/camel-core/src/test/java/org/apache/camel/management/ManagedRestRegistryTest.java
index a6976be..5f07d8c 100644
--- a/camel-core/src/test/java/org/apache/camel/management/ManagedRestRegistryTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedRestRegistryTest.java
@@ -64,6 +64,10 @@ public class ManagedRestRegistryTest extends ManagementTestSupport {
         TabularData data = (TabularData) mbeanServer.invoke(name, "listRestServices", null, null);
         assertEquals(3, data.size());
 
+        // should not be enabled as api-doc is not enabled or camel-swagger-java is not on classpath
+        String json = (String) mbeanServer.invoke(name, "apiDocAsJson", null, null);
+        assertNull(json);
+
         // remove all routes
         for (Route route : context.getRoutes()) {
             context.stopRoute(route.getId());


[3/4] camel git commit: CAMEL-9156: Add JMX api for the swagger api

Posted by da...@apache.org.
CAMEL-9156: Add JMX api for the swagger api


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

Branch: refs/heads/master
Commit: e26541acb06d70563551341ba105b390d4084059
Parents: cac4ae2
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Sep 24 10:59:39 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Sep 24 10:59:39 2015 +0200

----------------------------------------------------------------------
 .../camel/component/rest/RestApiEndpoint.java   |  2 +
 .../camel/component/rest/RestEndpoint.java      |  2 +
 .../management/mbean/ManagedRestRegistry.java   | 73 +++++++++++---------
 .../swagger/SwaggerRestApiProcessorFactory.java |  4 +-
 4 files changed, 47 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/e26541ac/camel-core/src/main/java/org/apache/camel/component/rest/RestApiEndpoint.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/rest/RestApiEndpoint.java b/camel-core/src/main/java/org/apache/camel/component/rest/RestApiEndpoint.java
index 7829a7c..f2ee48d 100644
--- a/camel-core/src/main/java/org/apache/camel/component/rest/RestApiEndpoint.java
+++ b/camel-core/src/main/java/org/apache/camel/component/rest/RestApiEndpoint.java
@@ -21,6 +21,7 @@ import java.util.Set;
 
 import org.apache.camel.Component;
 import org.apache.camel.Consumer;
+import org.apache.camel.ExchangePattern;
 import org.apache.camel.NoFactoryAvailableException;
 import org.apache.camel.NoSuchBeanException;
 import org.apache.camel.Processor;
@@ -57,6 +58,7 @@ public class RestApiEndpoint extends DefaultEndpoint {
 
     public RestApiEndpoint(String endpointUri, RestApiComponent component) {
         super(endpointUri, component);
+        setExchangePattern(ExchangePattern.InOut);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/camel/blob/e26541ac/camel-core/src/main/java/org/apache/camel/component/rest/RestEndpoint.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/rest/RestEndpoint.java b/camel-core/src/main/java/org/apache/camel/component/rest/RestEndpoint.java
index a226d70..f17110d 100644
--- a/camel-core/src/main/java/org/apache/camel/component/rest/RestEndpoint.java
+++ b/camel-core/src/main/java/org/apache/camel/component/rest/RestEndpoint.java
@@ -21,6 +21,7 @@ import java.util.Set;
 
 import org.apache.camel.Component;
 import org.apache.camel.Consumer;
+import org.apache.camel.ExchangePattern;
 import org.apache.camel.NoSuchBeanException;
 import org.apache.camel.Processor;
 import org.apache.camel.Producer;
@@ -62,6 +63,7 @@ public class RestEndpoint extends DefaultEndpoint {
 
     public RestEndpoint(String endpointUri, RestComponent component) {
         super(endpointUri, component);
+        setExchangePattern(ExchangePattern.InOut);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/camel/blob/e26541ac/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRestRegistry.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRestRegistry.java b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRestRegistry.java
index eca3508..cbcbcd6 100644
--- a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRestRegistry.java
+++ b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRestRegistry.java
@@ -33,6 +33,7 @@ import org.apache.camel.api.management.mbean.CamelOpenMBeanTypes;
 import org.apache.camel.api.management.mbean.ManagedRestRegistryMBean;
 import org.apache.camel.component.rest.RestApiEndpoint;
 import org.apache.camel.component.rest.RestEndpoint;
+import org.apache.camel.impl.ProducerCache;
 import org.apache.camel.spi.RestConfiguration;
 import org.apache.camel.spi.RestRegistry;
 import org.apache.camel.util.ObjectHelper;
@@ -45,6 +46,7 @@ import org.apache.camel.util.ServiceHelper;
 public class ManagedRestRegistry extends ManagedService implements ManagedRestRegistryMBean {
 
     private final RestRegistry registry;
+    private transient Producer apiProducer;
 
     public ManagedRestRegistry(CamelContext context, RestRegistry registry) {
         super(context, registry);
@@ -94,48 +96,53 @@ public class ManagedRestRegistry extends ManagedService implements ManagedRestRe
     @Override
     public String apiDocAsJson() {
         // see if there is a rest-api endpoint which would be the case if rest api-doc has been explicit enabled
-        Endpoint restApiEndpoint = null;
-        Endpoint restEndpoint = null;
-        for (Map.Entry<String, Endpoint> entry : getContext().getEndpointMap().entrySet()) {
-            String uri = entry.getKey();
-            if (uri.startsWith("rest-api:")) {
-                restApiEndpoint = entry.getValue();
-                break;
-            } else if (restEndpoint == null && uri.startsWith("rest:")) {
-                restEndpoint = entry.getValue();
+        if (apiProducer == null) {
+            Endpoint restApiEndpoint = null;
+            Endpoint restEndpoint = null;
+            for (Map.Entry<String, Endpoint> entry : getContext().getEndpointMap().entrySet()) {
+                String uri = entry.getKey();
+                if (uri.startsWith("rest-api:")) {
+                    restApiEndpoint = entry.getValue();
+                    break;
+                } else if (restEndpoint == null && uri.startsWith("rest:")) {
+                    restEndpoint = entry.getValue();
+                }
             }
-        }
 
-        if (restApiEndpoint == null && restEndpoint != null) {
-            // no rest-api has been explicit enabled, then we need to create it first
-            RestEndpoint rest = (RestEndpoint) restEndpoint;
-            String componentName = rest.getComponentName();
+            if (restApiEndpoint == null && restEndpoint != null) {
+                // no rest-api has been explicit enabled, then we need to create it first
+                RestEndpoint rest = (RestEndpoint) restEndpoint;
+                String componentName = rest.getComponentName();
 
-            if (componentName != null) {
-                RestConfiguration config = getContext().getRestConfiguration(componentName, true);
-                String apiComponent = config.getApiComponent() != null ? config.getApiComponent() : RestApiEndpoint.DEFAULT_API_COMPONENT_NAME;
-                String path = config.getApiContextPath() != null ? config.getApiContextPath() : "api-doc";
-                restApiEndpoint = getContext().getEndpoint(String.format("rest-api:%s/%s?componentName=%s&apiComponentName=%s&contextIdPattern=#name#", path, getCamelId(), componentName, apiComponent));
+                if (componentName != null) {
+                    RestConfiguration config = getContext().getRestConfiguration(componentName, true);
+                    String apiComponent = config.getApiComponent() != null ? config.getApiComponent() : RestApiEndpoint.DEFAULT_API_COMPONENT_NAME;
+                    String path = config.getApiContextPath() != null ? config.getApiContextPath() : "api-doc";
+                    restApiEndpoint = getContext().getEndpoint(String.format("rest-api:%s/%s?componentName=%s&apiComponentName=%s&contextIdPattern=#name#", path, getCamelId(), componentName, apiComponent));
+                }
             }
-        }
 
-        try {
             if (restApiEndpoint != null) {
-                Producer producer = restApiEndpoint.createProducer();
-                ServiceHelper.startService(producer);
-
+                // reuse the producer to avoid creating it
                 try {
-                    Exchange dummy = restApiEndpoint.createExchange();
-                    producer.process(dummy);
-
-                    String json = dummy.hasOut() ? dummy.getOut().getBody(String.class) : dummy.getIn().getBody(String.class);
-                    return json;
-                } finally {
-                    ServiceHelper.stopService(producer);
+                    apiProducer = restApiEndpoint.createProducer();
+                    getContext().addService(apiProducer, true);
+                } catch (Exception e) {
+                    throw ObjectHelper.wrapRuntimeCamelException(e);
                 }
             }
-        } catch (Exception e) {
-            throw ObjectHelper.wrapRuntimeCamelException(e);
+        }
+
+        if (apiProducer != null) {
+            try {
+                Exchange dummy = apiProducer.getEndpoint().createExchange();
+                apiProducer.process(dummy);
+
+                String json = dummy.hasOut() ? dummy.getOut().getBody(String.class) : dummy.getIn().getBody(String.class);
+                return json;
+            } catch (Exception e) {
+                throw ObjectHelper.wrapRuntimeCamelException(e);
+            }
         }
 
         return null;

http://git-wip-us.apache.org/repos/asf/camel/blob/e26541ac/components/camel-swagger-java/src/main/java/org/apache/camel/swagger/SwaggerRestApiProcessorFactory.java
----------------------------------------------------------------------
diff --git a/components/camel-swagger-java/src/main/java/org/apache/camel/swagger/SwaggerRestApiProcessorFactory.java b/components/camel-swagger-java/src/main/java/org/apache/camel/swagger/SwaggerRestApiProcessorFactory.java
index 45eff06..373db45 100644
--- a/components/camel-swagger-java/src/main/java/org/apache/camel/swagger/SwaggerRestApiProcessorFactory.java
+++ b/components/camel-swagger-java/src/main/java/org/apache/camel/swagger/SwaggerRestApiProcessorFactory.java
@@ -31,7 +31,9 @@ public class SwaggerRestApiProcessorFactory implements RestApiProcessorFactory {
                                         RestConfiguration configuration, Map<String, Object> parameters) throws Exception {
 
         Map<String, Object> options = new HashMap<String, Object>(parameters);
-        options.putAll(configuration.getApiProperties());
+        if (configuration.getApiProperties() != null) {
+            options.putAll(configuration.getApiProperties());
+        }
 
         // need to include host in options
         String host = (String) options.get("host");


[2/4] camel git commit: CAMEL-9156: Add JMX api for the swagger api

Posted by da...@apache.org.
CAMEL-9156: Add JMX api for the swagger api


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

Branch: refs/heads/master
Commit: cac4ae2d086e2994015a0a0eae4e2ab1712061d2
Parents: 35b59f1
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Sep 24 10:24:15 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Sep 24 10:24:15 2015 +0200

----------------------------------------------------------------------
 .../camel/component/rest/RestApiEndpoint.java   | 18 ++++++++----
 .../management/mbean/ManagedRestRegistry.java   | 31 ++++++++++++++++----
 2 files changed, 38 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/cac4ae2d/camel-core/src/main/java/org/apache/camel/component/rest/RestApiEndpoint.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/rest/RestApiEndpoint.java b/camel-core/src/main/java/org/apache/camel/component/rest/RestApiEndpoint.java
index 2ce98f7..7829a7c 100644
--- a/camel-core/src/main/java/org/apache/camel/component/rest/RestApiEndpoint.java
+++ b/camel-core/src/main/java/org/apache/camel/component/rest/RestApiEndpoint.java
@@ -21,10 +21,12 @@ import java.util.Set;
 
 import org.apache.camel.Component;
 import org.apache.camel.Consumer;
+import org.apache.camel.NoFactoryAvailableException;
 import org.apache.camel.NoSuchBeanException;
 import org.apache.camel.Processor;
 import org.apache.camel.Producer;
 import org.apache.camel.impl.DefaultEndpoint;
+import org.apache.camel.spi.FactoryFinder;
 import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.RestApiConsumerFactory;
 import org.apache.camel.spi.RestApiProcessorFactory;
@@ -41,7 +43,8 @@ public class RestApiEndpoint extends DefaultEndpoint {
     public static final String DEFAULT_API_COMPONENT_NAME = "swagger";
     public static final String RESOURCE_PATH = "META-INF/services/org/apache/camel/rest/";
 
-    @UriPath @Metadata(required = "true")
+    @UriPath
+    @Metadata(required = "true")
     private String path;
     @UriPath
     private String contextIdPattern;
@@ -137,9 +140,14 @@ public class RestApiEndpoint extends DefaultEndpoint {
             if (name == null) {
                 name = DEFAULT_API_COMPONENT_NAME;
             }
-            Object instance = getCamelContext().getFactoryFinder(RESOURCE_PATH).newInstance(name);
-            if (instance instanceof RestApiProcessorFactory) {
-                factory = (RestApiProcessorFactory) instance;
+            try {
+                FactoryFinder finder = getCamelContext().getFactoryFinder(RESOURCE_PATH);
+                Object instance = finder.newInstance(name);
+                if (instance instanceof RestApiProcessorFactory) {
+                    factory = (RestApiProcessorFactory) instance;
+                }
+            } catch (NoFactoryAvailableException e) {
+                // ignore
             }
         }
 
@@ -183,7 +191,7 @@ public class RestApiEndpoint extends DefaultEndpoint {
             Processor processor = factory.createApiProcessor(getCamelContext(), path, getContextIdPattern(), contextIdListing, config, getParameters());
             return new RestApiProducer(this, processor);
         } else {
-            throw new IllegalStateException("Cannot find RestApiProcessorFactory in Registry or classpath");
+            throw new IllegalStateException("Cannot find RestApiProcessorFactory in Registry or classpath (such as the camel-swagger-java component)");
         }
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/cac4ae2d/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRestRegistry.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRestRegistry.java b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRestRegistry.java
index e9e5f7c..eca3508 100644
--- a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRestRegistry.java
+++ b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRestRegistry.java
@@ -31,6 +31,9 @@ import org.apache.camel.Producer;
 import org.apache.camel.api.management.ManagedResource;
 import org.apache.camel.api.management.mbean.CamelOpenMBeanTypes;
 import org.apache.camel.api.management.mbean.ManagedRestRegistryMBean;
+import org.apache.camel.component.rest.RestApiEndpoint;
+import org.apache.camel.component.rest.RestEndpoint;
+import org.apache.camel.spi.RestConfiguration;
 import org.apache.camel.spi.RestRegistry;
 import org.apache.camel.util.ObjectHelper;
 import org.apache.camel.util.ServiceHelper;
@@ -91,22 +94,38 @@ public class ManagedRestRegistry extends ManagedService implements ManagedRestRe
     @Override
     public String apiDocAsJson() {
         // see if there is a rest-api endpoint which would be the case if rest api-doc has been explicit enabled
-        Endpoint found = null;
+        Endpoint restApiEndpoint = null;
+        Endpoint restEndpoint = null;
         for (Map.Entry<String, Endpoint> entry : getContext().getEndpointMap().entrySet()) {
             String uri = entry.getKey();
-            if (uri.startsWith("rest-api")) {
-                found = entry.getValue();
+            if (uri.startsWith("rest-api:")) {
+                restApiEndpoint = entry.getValue();
                 break;
+            } else if (restEndpoint == null && uri.startsWith("rest:")) {
+                restEndpoint = entry.getValue();
+            }
+        }
+
+        if (restApiEndpoint == null && restEndpoint != null) {
+            // no rest-api has been explicit enabled, then we need to create it first
+            RestEndpoint rest = (RestEndpoint) restEndpoint;
+            String componentName = rest.getComponentName();
+
+            if (componentName != null) {
+                RestConfiguration config = getContext().getRestConfiguration(componentName, true);
+                String apiComponent = config.getApiComponent() != null ? config.getApiComponent() : RestApiEndpoint.DEFAULT_API_COMPONENT_NAME;
+                String path = config.getApiContextPath() != null ? config.getApiContextPath() : "api-doc";
+                restApiEndpoint = getContext().getEndpoint(String.format("rest-api:%s/%s?componentName=%s&apiComponentName=%s&contextIdPattern=#name#", path, getCamelId(), componentName, apiComponent));
             }
         }
 
         try {
-            if (found != null) {
-                Producer producer = found.createProducer();
+            if (restApiEndpoint != null) {
+                Producer producer = restApiEndpoint.createProducer();
                 ServiceHelper.startService(producer);
 
                 try {
-                    Exchange dummy = found.createExchange();
+                    Exchange dummy = restApiEndpoint.createExchange();
                     producer.process(dummy);
 
                     String json = dummy.hasOut() ? dummy.getOut().getBody(String.class) : dummy.getIn().getBody(String.class);


[4/4] camel git commit: CAMEL-9156: Add JMX api for the swagger api

Posted by da...@apache.org.
CAMEL-9156: Add JMX api for the swagger api


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

Branch: refs/heads/master
Commit: 3ba8059873cbfbd30a23ecebc66555178511bcdd
Parents: e26541a
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Sep 24 11:05:55 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Sep 24 11:05:55 2015 +0200

----------------------------------------------------------------------
 .../main/java/org/apache/camel/example/cdi/UserRouteBuilder.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/3ba80598/examples/camel-example-swagger-cdi/src/main/java/org/apache/camel/example/cdi/UserRouteBuilder.java
----------------------------------------------------------------------
diff --git a/examples/camel-example-swagger-cdi/src/main/java/org/apache/camel/example/cdi/UserRouteBuilder.java b/examples/camel-example-swagger-cdi/src/main/java/org/apache/camel/example/cdi/UserRouteBuilder.java
index e30d978..c746082 100644
--- a/examples/camel-example-swagger-cdi/src/main/java/org/apache/camel/example/cdi/UserRouteBuilder.java
+++ b/examples/camel-example-swagger-cdi/src/main/java/org/apache/camel/example/cdi/UserRouteBuilder.java
@@ -38,7 +38,7 @@ public class UserRouteBuilder extends RouteBuilder {
             // and output using pretty print
             .dataFormatProperty("prettyPrint", "true")
             // setup context path and port number that netty will use
-            .contextPath("/rest").port(8080)
+            .contextPath("/").port(8080)
             // add swagger api-doc out of the box
             .apiContextPath("/api-doc")
                 .apiProperty("api.title", "User API").apiProperty("api.version", "1.2.3")