KaotoIO / kaoto-backend

Backend for the Kaoto project to provide an easy to use integration framework based on Apache Camel.
Apache License 2.0
75 stars 32 forks source link

Decouple Rest model from KameletPopulator #802

Open lburgazzoli opened 1 year ago

lburgazzoli commented 1 year ago

The Rest model class has a field to hold a KamelPolulator this causes quarkus to report the following warning:

2023-07-21 17:25:53,008 WARN  [io.quarkus.deployment.steps.ReflectiveHierarchyStep] (build-37) Unable to properly register the hierarchy of the following classes for reflection as they are not in the Jandex index:
        - io.vertx.core.Vertx (source: JacksonProcessor > io.kaoto.backend.camel.model.deployment.kamelet.step.From)
        - io.vertx.core.http.HttpClient (source: JacksonProcessor > io.kaoto.backend.camel.model.deployment.kamelet.step.From)
        - io.vertx.core.http.WebSocket (source: JacksonProcessor > io.kaoto.backend.camel.model.deployment.kamelet.step.From)
        - io.vertx.core.net.ProxyType (source: JacksonProcessor > io.kaoto.backend.camel.model.deployment.kamelet.step.From)
        - jakarta.enterprise.inject.Instance (source: JacksonProcessor > io.kaoto.backend.camel.model.deployment.kamelet.step.From)
        - javax.net.ssl.KeyManager (source: JacksonProcessor > io.kaoto.backend.camel.model.deployment.kamelet.step.From)
        - javax.net.ssl.SSLContext (source: JacksonProcessor > io.kaoto.backend.camel.model.deployment.kamelet.step.From)
        - javax.net.ssl.TrustManager (source: JacksonProcessor > io.kaoto.backend.camel.model.deployment.kamelet.step.From)
        - okhttp3.OkHttpClient (source: JacksonProcessor > io.kaoto.backend.camel.model.deployment.kamelet.step.From)
        - okhttp3.OkHttpClient$Builder (source: JacksonProcessor > io.kaoto.backend.camel.model.deployment.kamelet.step.From)
        - okhttp3.Request$Builder (source: JacksonProcessor > io.kaoto.backend.camel.model.deployment.kamelet.step.From)
        - okhttp3.WebSocket (source: JacksonProcessor > io.kaoto.backend.camel.model.deployment.kamelet.step.From)
        - okio.BufferedSource (source: JacksonProcessor > io.kaoto.backend.camel.model.deployment.kamelet.step.From)

However this is only the top of the iceberg as what happen behind the scene is that a very large amount of classes are added to the list of classes to be registered (because the KamelPolulator has a StepCatalog which has other fields, etc).

At this stage this is only a warning and does not compromise the behavior of the application, however it is likely that a number o classes is registered for refection where it should not be resulting in larger native image and longer build time.

In addition it seems to reveal some design smells as:

Ideally Rest should probably not need KamelPopulator

stale[bot] commented 10 months ago

🚨This issue has been automatically marked as stale because it has not had recent activity.🚨 If you are still interested in this issue, please, leave a comment stating its current status. Note that if no development resources has been allocated on it, you may need to search for alternative resources to complete it. It will be closed if no further activity occurs. Thank you for your contributions.