ppalaga commented on issue #617: Build time Camel service resolution
URL: https://github.com/apache/camel-quarkus/issues/617#issuecomment-574115196
 
 
   > > C. My original proposal: Custom FactoryFinder assembled at build time, 
no need to include the property files in the native image.
   > 
   > The problem I see here is: what services do you add to the new factory 
finder "map" 
   
   The map is from property file paths (e.g. 
`META-INF/services/org/apache/camel/configurer/telegram-component`) to classes 
(e.g. `org.apache.camel.component.telegram.TelegramComponentConfigurer.class`) 
and my current implementation adds all available paths and classes to the map. 
Here is the code: https://github.com/apache/camel-quarkus/pull/618
   
   > and what do you add to the registry ?
   
   No change against what we currently do. 
   
   My understanding is that FactoryFinders and Registry serve different, but 
slightly overlapping purposes. Most notably, a FactoryFinder can find a class 
by path + name, which Registry cannot.
   
   > I guess at the end we do end up having the same service registered to 
different "registries", because we do not know what is the patter 3th party 
libraries are using, isn't it ?
   
   Yes, FactoryFinders and the registry will contain slightly overlapping data, 
but not 100% identical.
   The access keys are also different: FactoryFinders use hierarchic names 
(they include the resource path), while the registry names are flat. 
   
   > May be we should have the factory finder to hooks into the registry or 
move every discovered service from the camel registry to the factory finder 
(but this requires some other changes in the FastCamelContext)
   
   I am not sure FactoryFinders backed by a Registry covering all cases would 
be possible. Sounds like you assume the property file name is always equal to 
the name of the service in the registry. Based on @davsclaus comments in 
https://github.com/apache/camel/pull/3478#discussion_r366198855 I am not sure 
this is always true.
   
   Besides, is your FactoryFinders backed by a Registry meant to happen in 
Camel or here?
    
   > > Both A. and C. sound like acceptable solutions to me, C. being more in 
accordance with the spirit of Quarkus.
   > 
   > An intermediate solution would be to have an option to
   > 
   > 1. store the service files in the native image
   > 2. have the factory finder to emit a warning when it loads from a file
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to