camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sverker Abrahamsson (JIRA)" <>
Subject [jira] [Commented] (CAMEL-10391) Camel-CDI adds every RouteBuilder instance it can find to Camel context
Date Mon, 21 Nov 2016 18:07:58 GMT


Sverker Abrahamsson commented on CAMEL-10391:

How do you do optional injects in other way than using Optional? CdiCamelExtension isn't serializable
neither so that part shouldn't be a problem. Top pom in camel still defines jdk version to

Agreed that an interface is better for type safety. How would the event variant work?

> Camel-CDI adds every RouteBuilder instance it can find to Camel context
> -----------------------------------------------------------------------
>                 Key: CAMEL-10391
>                 URL:
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-cdi
>    Affects Versions: 2.18.0
>         Environment: Wildfly 10 with wildfly-camel extension
>            Reporter: Sverker Abrahamsson
>            Assignee: Antonin Stefanutti
> Camel-CDI will find every class in a deployment which extends RouteBuilder and automatically
add them to the context. This is a major issue for me as I usually wants to instantiate my
RouteBuilders programatically setting various parameters, with CDI support.
> This behaviour was introduced with
from [~antonin.stefanutti] and we had a good discussion about the issue on his github project
in but never came up with a good solution
for it. I have patched camel-cdi to use a marker annotation @DoNotAddToCamelContext to work
around it but I don't want to have to patch every release I use..
> I understand the logic why Camel-CDI finds and add every RouteBuilder class, even though
I don't agree that it is a good idea but it could very well be the default behavior as long
as it is possible to override it.
> What I would like is a discussion on how this could be made configurable. I'm thinking
about if there could be an annotation like @CamelContextStartup(false) or maybe even a more
general @CamelContextConfig(autostart=false) if there are other things that should be configurable.

This message was sent by Atlassian JIRA

View raw message