camel-quarkus icon indicating copy to clipboard operation
camel-quarkus copied to clipboard

Use built-in ServiceLoader initializer for native

Open apupier opened this issue 2 months ago • 2 comments

Description

Currently, all Service Loaders are initialized through specific classes. It means some code to maintain and also that each time Camel is adding a Service that we need to add a class. Quarkus is providing an option to register them automatically https://quarkus.io/guides/building-native-image#quarkus-core_quarkus-native-auto-service-loader-registration

https://github.com/apache/camel-quarkus/tree/main/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/spi

apupier avatar Oct 20 '25 09:10 apupier

Hi @apupier using the one point for registration of all service loaders would be helpful indeed. (it would allow us to remove a lot of code). On the other hand there are several places like this and this. where several services are directly excluded. There is also another functionality linked to CQ's serviceLoaderBuildItems -> loading into camel registry, see this enum.

Therefore I'd say that we should keep the current approach. WDYT?

JiriOndrusek avatar Dec 03 '25 12:12 JiriOndrusek

We could extend the quarkus functionality and add filters there (i.e. as build items), which would allow us to filter out/in some service...

JiriOndrusek avatar Dec 03 '25 12:12 JiriOndrusek