Hi

If you are using spring boot, quarkus, cdi etc then they have auto
configuration and cdi startup annotations you can use to trigger custom
code.

If you talk about plain standalone camel then its a bit more work to do,
but we do this with some classpath scanning such as what we can do when you
have camel-debug JAR on classpath or not. You could have your own service
factory class you active on startup that then scans for custom JARs with a
specific @JdkService factory which then can trigger calling this on startup
where you can do custom code.





On Sat, Oct 1, 2022 at 4:36 AM ski n <raymondmees...@gmail.com> wrote:

> I can register a bean like this:
>
> Registry registry = context.getRegistry();
> registry.bind("CurrentAggregateStrategy", new AggregateStrategy());
>
> But I want this dependency to be optional, so I am not sure that the class
> (in this example AggregateStrategy) is on the classpath.
>
> Is it possible that the bean can autoregister itself?
>
> Raymond
>


-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Reply via email to