[ 
https://issues.apache.org/jira/browse/CAMEL-8436?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Drozdov updated CAMEL-8436:
----------------------------------
    Attachment: camel-spring-boot-issue.tar.gz

Managed to reproduce the issue in minimal project - gradle one, not maven, 
sorry.
Attached the project.

If you {{./gradlew run}} it, you get:
{noformat}
2015-03-04 19:46:28.102  INFO 32637 --- [           main] 
o.a.camel.spring.SpringCamelContext      : Route: route1 started and consuming 
from: Endpoint[direct://1]
2015-03-04 19:46:28.116  INFO 32637 --- [           main] 
o.a.camel.spring.SpringCamelContext      : Route: route2 started and consuming 
from: Endpoint[direct://2]
2015-03-04 19:46:28.131  INFO 32637 --- [           main] 
o.a.camel.spring.SpringCamelContext      : Route: route3 started and consuming 
from: Endpoint[direct://5]
{noformat}

If you do {{mv 
src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java.thisworks
 src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java}} and 
run it once again, you get:
{noformat}
2015-03-04 19:48:15.225  INFO 464 --- [           main] 
o.a.camel.spring.SpringCamelContext      : Route: route1 started and consuming 
from: Endpoint[direct://1]
2015-03-04 19:48:15.241  INFO 464 --- [           main] 
o.a.camel.spring.SpringCamelContext      : Route: route2 started and consuming 
from: Endpoint[direct://2]
2015-03-04 19:48:15.265  INFO 464 --- [           main] 
o.a.camel.spring.SpringCamelContext      : Route: route3 started and consuming 
from: Endpoint[direct://3]
2015-03-04 19:48:15.286  INFO 464 --- [           main] 
o.a.camel.spring.SpringCamelContext      : Route: route4 started and consuming 
from: Endpoint[direct://4]
2015-03-04 19:48:15.309  INFO 464 --- [           main] 
o.a.camel.spring.SpringCamelContext      : Route: route5 started and consuming 
from: Endpoint[direct://5]
{noformat}

Something wrong is with this injection:
{code}
    @Resource
    private ProducerTemplate producerTemplate;
{code}
only the first route that has it, is initialized.

In the real project ProducerTemplate is injected in some other beans and they 
are injected in the SpringRouteBuilder ones, and the result is the same.

> camel-spring-boot - Some routes not being initialized after CamelContext have 
> been removed from CamelAutoConfiguration
> ----------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-8436
>                 URL: https://issues.apache.org/jira/browse/CAMEL-8436
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-spring-boot
>    Affects Versions: 2.15.0
>            Reporter: Dmitry Drozdov
>            Assignee: Henryk Konsek
>             Fix For: 2.15.1
>
>         Attachments: camel-spring-boot-issue.tar.gz
>
>
> In our project we have several classes that extend SpringRouteBuilder and 
> that are annotated with @Component.
> Some days ago we've noticed that most of them stopped being initialized on 
> application startup.
> Found out that our issues started from this commit:
> https://github.com/apache/camel/commit/6bcc0b6110a762623888ded294c78dc168a18e75
> If I roll it back everything is fine again.



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

Reply via email to