nicolaferraro opened a new issue #267: Cannot find RestApiConsumerFactory
URL: https://github.com/apache/camel-k-runtime/issues/267
 
 
   Simple rest route:
   
   ```
   // camel-k: language=java
   
   import org.apache.camel.builder.RouteBuilder;
   
   public class Called extends RouteBuilder {
     @Override
     public void configure() throws Exception {
   
                rest().get("/")
                  .route()
                  .setBody().constant("Ciao");
     }
   }
   
   ```
   
   
   Running it with:
   ```
   kamel run examples/Called.java --profile Kubernetes -p 
camel.context.rest-configuration.port=8080 -p 
camel.context.rest-configuration.api-context-path=/api-doc -d camel-openapi-java
   ```
   
   Does not work:
   ```
   called-f7fd4c4bd-xltsb integration Caused by: 
java.lang.IllegalStateException: Cannot find RestApiConsumerFactory in Registry 
or as a Component to use
   called-f7fd4c4bd-xltsb integration      at 
org.apache.camel.component.rest.RestApiEndpoint.createConsumer(RestApiEndpoint.java:279)
   called-f7fd4c4bd-xltsb integration      at 
org.apache.camel.impl.engine.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:69)
   called-f7fd4c4bd-xltsb integration      at 
org.apache.camel.impl.engine.DefaultRoute.onStartingServices(DefaultRoute.java:120)
   called-f7fd4c4bd-xltsb integration      at 
org.apache.camel.impl.engine.BaseRouteService.doWarmUp(BaseRouteService.java:158)
   called-f7fd4c4bd-xltsb integration      at 
org.apache.camel.impl.engine.BaseRouteService.warmUp(BaseRouteService.java:131)
   called-f7fd4c4bd-xltsb integration      ... 14 more
   ```
   
   
   This works instead:
   
   ```
   run examples/Called.java --profile Kubernetes -p 
camel.context.rest-configuration.port=8080 -p 
camel.context.rest-configuration.api-context-path=/api-doc -d 
camel-openapi-java -p camel.context.rest-configuration.component=undertow
   ```
   
   Logs:
   ```
   called-777cbccff5-8ln8n integration 2020-03-16 10:32:51.206 INFO  [main] nio 
- XNIO NIO Implementation Version 3.3.8.Final
   called-777cbccff5-8ln8n integration 2020-03-16 10:32:51.274 INFO  [main] 
AbstractCamelContext - Route: route1 started and consuming from: 
http://0.0.0.0:8080/api-doc
   called-777cbccff5-8ln8n integration 2020-03-16 10:32:51.275 INFO  [main] 
AbstractCamelContext - Route: route2 started and consuming from: 
http://0.0.0.0:8080/
   called-777cbccff5-8ln8n integration 2020-03-16 10:32:51.279 INFO  [main] 
AbstractCamelContext - Total 2 routes, of which 2 are started
   called-777cbccff5-8ln8n integration 2020-03-16 10:32:51.279 INFO  [main] 
AbstractCamelContext - Apache Camel 3.1.0 (CamelContext: camel-k) started in 
0.259 seconds
   called-777cbccff5-8ln8n integration 2020-03-16 10:32:51.280 INFO  [main] 
ApplicationRuntime - Listener org.apache.camel.k.listener.RoutesDumper@2aceadd4 
executed in phase Started
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to