Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find RestApiConsumerFactory #267

Closed
nicolaferraro opened this issue Mar 16, 2020 · 2 comments
Closed

Cannot find RestApiConsumerFactory #267

nicolaferraro opened this issue Mar 16, 2020 · 2 comments
Assignees
Milestone

Comments

@nicolaferraro
Copy link
Member

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
@lburgazzoli
Copy link
Contributor

can you add the details of the integration kits ?

@lburgazzoli lburgazzoli added this to the 1.3.0 milestone Mar 20, 2020
@lburgazzoli
Copy link
Contributor

@nicolaferraro this should be fixed now right ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants