Hi Luca,
I think this approach with EhcacheComponentConfigurer is really nice,
it allows you to also have additional jars on classpath, separate form
the -starter jars, to perform additional configuration, that could
prove be very flexible.

One use case I can think of is to have a *ComponentConfigurer that
configures custom TLS properties to multiple components or configures
username/passwords. Might be far fetched but it's a possibility that
opens up with this approach. Somewhat same can be done with
BeanDefinitionRegistryPostProcessor approach but it would be more
complex IMHO,

zoran

On Wed, May 17, 2017 at 12:29 PM, Luca Burgazzoli <lburgazz...@gmail.com> wrote:
> Yeah that's something I was thinking about but then I ended up with
> testing something different, do not know if it is the best way :)
>
> So the camel-package-maven-plugin would generate:
>
> - 
> org.apache.camel.component.ehcache.springboot.EhcacheComponentAutoConfiguration
> - org.apache.camel.component.ehcache.springboot.EhcacheComponentConfiguration
> - org.apache.camel.component.ehcache.springboot.EhcacheComponentConfigurer
> - org.apache.camel.component.ehcache.springboot.configurer.DefaultConfigurer
>
> Then EhcacheComponentAutoConfiguration applies all the configurer
> (type EhcacheComponentConfigurer) it can found to the EhcacheComponent
> it is setting up and there will be at least one that is the
> DefaultConfigurer that simply apply the properties from
> EhcacheComponentConfiguration. The advantage of this method is that we
> can use standard spring annotation to include/exclude configurer
> without having to manually write all the conditions.
>
> I've created a simple example here:
> https://github.com/lburgazzoli/camel-ehcache-starter
>
> ---
> Luca Burgazzoli
>
>
> On Tue, May 16, 2017 at 11:19 PM, Zoran Regvart <zo...@regvart.com> wrote:
>> Hi Luca,
>>
>> On Tue, May 16, 2017 at 6:23 PM, Luca Burgazzoli <lburgazz...@gmail.com> 
>> wrote:
>>> What would be the best option to keep the auto generation awesomeness
>>> and at the same time have a way to tweak the process ?
>>
>> BeanDefinitionRegistryPostProcessor can remove and add bean
>> definitions, so you can do pretty much anything you need.
>>
>> So perhaps a BeanDefinitionRegistryPostProcessor to load custom SPI to
>> perform additional post processing of the bean definition registry,
>> then have this BeanDefinitionRegistryPostProcessor and SPI interface
>> in camel-spring-boot, and the implementation of the SPI in the
>> component starter. The SPI implementation can be loaded using
>> FactoryFinder.
>>
>> zoran
>> --
>> Zoran Regvart



-- 
Zoran Regvart

Reply via email to