Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

[camel k] inconsistent libs for webhook and api provider #4835

Closed
nicolaferraro opened this issue Mar 11, 2019 · 7 comments
Closed

[camel k] inconsistent libs for webhook and api provider #4835

nicolaferraro opened this issue Mar 11, 2019 · 7 comments
Assignees
Labels
cat/bug A bug which needs fixing group/camel-k prio/p1 The priority of a bug. p1 means high

Comments

@nicolaferraro
Copy link
Contributor

This is a...


[ ] Feature request
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Documentation issue or request

Description

Both webhook and api provider are based on the Camel servlet component which expects that the runtime will provide a server. This is true for spring-boot based integrations where we add spring-boot-web by default, but Camel K integrations are no more spring-boot based.

@pure-bot pure-bot bot added the notif/triage The issue needs triage. Applied automatically to all new issues. label Mar 11, 2019
@lburgazzoli lburgazzoli added prio/p0 The priority of a bug. p0 means blocking cat/bug A bug which needs fixing labels Mar 11, 2019
@lburgazzoli lburgazzoli added this to the Sprint 43 (4/4) milestone Mar 11, 2019
@heiko-braun
Copy link
Collaborator

heiko-braun commented Mar 14, 2019

We could overcome some of these issues when Camel-K is enabled, by introducing a strategy pattern that allows to fallback to the current means of creating integrations for cases that don't work (i.e. blacklisted in meta data)

@heiko-braun heiko-braun removed notif/triage The issue needs triage. Applied automatically to all new issues. labels Mar 14, 2019
@heiko-braun heiko-braun removed this from the Sprint 43 (4/4) milestone Mar 14, 2019
@zregvart
Copy link
Member

The only dependency in API provider on the Servlet API that I can see is SpecificationContentTypeFilter, which we can remove by using api.specification.contentType.json and api.specification.contentType.yaml Camel REST properties here:

We can add:

diff --git a/app/integration/project-generator/src/test/resources/io/syndesis/integration/project/generator/testGenerateApplicationWithRestDSL/RestRouteConfiguration.java b/app/integration/project-generator/src/test/resources/io/syndesis/integration/project/generator/testGenerateApplicationWithRestDSL/RestRouteConfiguration.java
index 5b2da2572..18afdf45a 100644
--- a/app/integration/project-generator/src/test/resources/io/syndesis/integration/project/generator/testGenerateApplicationWithRestDSL/RestRouteConfiguration.java
+++ b/app/integration/project-generator/src/test/resources/io/syndesis/integration/project/generator/testGenerateApplicationWithRestDSL/RestRouteConfiguration.java
@@ -16,6 +16,8 @@ public class RestRouteConfiguration {
                 restConfiguration()
                     .contextPath("/")
                     .component("servlet")
+                    .apiProperty("api.specification.contentType.json", "application/vnd.oai.openapi+json;version=2.0")
+                    .apiProperty("api.specification.contentType.yaml", "application/vnd.oai.openapi;version=2.0")
                     .endpointProperty("headerFilterStrategy", "syndesisHeaderStrategy");
 
                 rest()

For the Webook, I think we can also configure it not via ServletRegistrationBean but with REST DSL API.

These changes in the end will allow us to use any component that supports Camel REST DSL. I see Camel-K has an example with Restlet, but we can (probably) use Netty, Jetty or Undertow.

@lburgazzoli
Copy link
Collaborator

lburgazzoli commented Mar 14, 2019

The problem is that the components are based on the servlet component and they are supposed to use the one that spring provides, so also the customizer we have do not work in a non spring world (afaik)

@zregvart
Copy link
Member

We currently have a great deal of connectors using the customizers (find . -name '*Customizer.java'|cut -d '/' -f 2|sort -u):

  • api-provider
  • aws-s3
  • fhir
  • gmail
  • google-calendar
  • google-sheets
  • kudu
  • odata
  • rest-swagger
  • salesforce
  • servicenow
  • slack
  • sql
  • telegram
  • webhook

Seems to me we need to provide support for loading these in Camel-K, perhaps some form of service loading, we can then generate the META-INF/service for Camel-K and leave the current spring.factories for Spring Boot based integration publish.

@lburgazzoli
Copy link
Collaborator

lburgazzoli commented Mar 14, 2019

sorry it is not the customizers it is this: https://github.com/syndesisio/syndesis/blob/master/app/connector/api-provider/src/main/resources/spring.factories

we do not have yet a generic support in this for camel-k

@zregvart
Copy link
Member

We can push SyndesisHeaderStrategy to the customizers in most cases I think. We can also register it via Camel's registry.

@heiko-braun heiko-braun added prio/p1 The priority of a bug. p1 means high and removed prio/p0 The priority of a bug. p0 means blocking labels Mar 18, 2019
@heiko-braun
Copy link
Collaborator

Lowering the priority after talking to Gary

@valdar valdar self-assigned this May 17, 2019
valdar added a commit to valdar/syndesis that referenced this issue May 23, 2019
valdar added a commit to valdar/syndesis that referenced this issue May 23, 2019
@valdar valdar closed this as completed May 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cat/bug A bug which needs fixing group/camel-k prio/p1 The priority of a bug. p1 means high
Projects
None yet
Development

No branches or pull requests

5 participants