camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-10391) Camel-CDI adds every RouteBuilder instance it can find to Camel context
Date Tue, 29 Nov 2016 19:03:59 GMT

    [ https://issues.apache.org/jira/browse/CAMEL-10391?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15706212#comment-15706212
] 

ASF GitHub Bot commented on CAMEL-10391:
----------------------------------------

GitHub user sverkera opened a pull request:

    https://github.com/apache/camel/pull/1320

    Created a mechanism to configure Camel CDI via CDI event.

    See https://issues.apache.org/jira/browse/CAMEL-10391 for details, patch for 2.18.x branch

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/sverkera/camel camel-2.18.x

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/camel/pull/1320.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1320
    
----
commit 17ad17af8cc91fd3c319ad109ead8a5962cc4b9f
Author: Sverker Abrahamsson <sverker@limetransit.com>
Date:   2016-11-29T18:51:31Z

    Created a mechanism to configure Camel CDI via CDI event.
    Currently the only setting is to turn off automatic add of RouteBuilders
    to context.

----


> Camel-CDI adds every RouteBuilder instance it can find to Camel context
> -----------------------------------------------------------------------
>
>                 Key: CAMEL-10391
>                 URL: https://issues.apache.org/jira/browse/CAMEL-10391
>             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 https://github.com/apache/camel/commit/0421c24dfcf992f3296ed746469771e3800200e3
from [~antonin.stefanutti] and we had a good discussion about the issue on his github project
in https://github.com/astefanutti/camel-cdi/issues/12 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
(v6.3.4#6332)

Mime
View raw message