Christian Bauer created CAMEL-8325:
--------------------------------------

             Summary: Spring Boot and CDI integration don't detect duplicate 
routes, should support earlier context configuration
                 Key: CAMEL-8325
                 URL: https://issues.apache.org/jira/browse/CAMEL-8325
             Project: Camel
          Issue Type: Improvement
          Components: camel-cdi, camel-spring-boot
    Affects Versions: 2.14.1
            Reporter: Christian Bauer


See discussion:

http://mail-archives.apache.org/mod_mbox/camel-users/201502.mbox/%3C8713C0A9-5CB3-45AC-871F-F58ECC28C71E%40christianbauer.name%3E

Most users in both Spring Booth and CDI environments probably rely on 
auto-discovery of routes, so duplicate route identifiers are a common mistake 
and should be detected. For this to work, routes have to be added before the 
CamelContext is started. 

This affects both Spring Boot and CDI integration, where the routes are added 
after CamelContext start, which results in replacement of duplicates without 
error.

The CDI integration code is actually worse than the Spring Boot code, since 
users have no chance of customizing the CamelContext with a 
CamelContextConfiguration. In the Spring Boot integration there is at least 
that option available to access the CamelContext after it has started, although 
that still doesn't give you access to the important configuration options such 
as ManagementStrategy.

I recommend in both Spring Boot and CDI integration to share a (new?) 
CamelContextConfiguration interface with methods beforeContextStart(CamelContxt 
ctx) and afterContextStart(CamelContext ctx). Instances of that type should be 
auto-discovered so the user has a chance to edit the CamelContext.




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to