Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Decouple Rest model from KameletPopulator  #802

@lburgazzoli

Description

@lburgazzoli

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    wontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions