You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by zr...@apache.org on 2017/03/04 13:17:09 UTC

camel git commit: CAMEL-10939 Restlet contract for RestConsumerFa...

Repository: camel
Updated Branches:
  refs/heads/master f5f187bd7 -> cc2ff1185


CAMEL-10939 Restlet contract for RestConsumerFa...

...ctory does not start the Endpoint

This relates to CAMEL-10935 and the change made in CAMEL-10928. The
Endpoint created in `createConsumer` needs to be started otherwise
`NullPointerException` occurs in RestletConsumer:65 when the `null`
`restletBinding` is acted upon.


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

Branch: refs/heads/master
Commit: cc2ff1185cd10c207009fe67ca06cdf3f9ac55d0
Parents: f5f187b
Author: Zoran Regvart <zr...@apache.org>
Authored: Sat Mar 4 14:15:39 2017 +0100
Committer: Zoran Regvart <zr...@apache.org>
Committed: Sat Mar 4 14:16:47 2017 +0100

----------------------------------------------------------------------
 .../java/org/apache/camel/component/restlet/RestletComponent.java | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/cc2ff118/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/RestletComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/RestletComponent.java b/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/RestletComponent.java
index 1a3b24f..f668f9e 100644
--- a/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/RestletComponent.java
+++ b/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/RestletComponent.java
@@ -816,6 +816,9 @@ public class RestletComponent extends HeaderFilterStrategyComponent implements R
         RestletEndpoint endpoint = camelContext.getEndpoint(url, RestletEndpoint.class);
         setProperties(camelContext, endpoint, parameters);
 
+        // the endpoint must be started before creating the consumer
+        ServiceHelper.startService(endpoint);
+
         // configure consumer properties
         Consumer consumer = endpoint.createConsumer(processor);
         if (config.getConsumerProperties() != null && !config.getConsumerProperties().isEmpty()) {