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

Pasquale Congiusti commented on CAMEL-16063:
--------------------------------------------

With this change I think we can have a problem when we include external routes, 
(ie, camel.springboot.java-routes-include-pattern = io/syndesis/example/*). In 
such situation it seems we duplicate the Post-processing CamelContext, see:

{code}
2021-02-23 17:18:28.406 DEBUG 97383 --- [           main] 
o.a.camel.spring.boot.RoutesCollector    : Post-processing CamelContext bean: 
tea
2021-02-23 17:18:28.407 DEBUG 97383 --- [           main] 
o.a.camel.spring.boot.RoutesCollector    : Java RoutesBuilder: 
io/syndesis/example/RestRouteConfiguration$1 accepted by include/exclude 
filter: true
2021-02-23 17:18:28.407 DEBUG 97383 --- [           main] 
o.a.camel.spring.boot.RoutesCollector    : Injecting following route into the 
CamelContext: Routes: []
2021-02-23 17:18:28.420 DEBUG 97383 --- [           main] 
o.a.camel.spring.boot.RoutesCollector    : Java RoutesBuilder: 
io/syndesis/example/RestRoute accepted by include/exclude filter: true
2021-02-23 17:18:28.420 DEBUG 97383 --- [           main] 
o.a.camel.spring.boot.RoutesCollector    : Injecting following route into the 
CamelContext: Routes: []
...
2021-02-23 17:18:28.835 DEBUG 97383 --- [           main] 
o.a.camel.spring.boot.RoutesCollector    : Post-processing CamelContext bean: 
tea
2021-02-23 17:18:28.835 DEBUG 97383 --- [           main] 
o.a.camel.spring.boot.RoutesCollector    : Java RoutesBuilder: 
io/syndesis/example/RestRouteConfiguration$1 accepted by include/exclude 
filter: true
2021-02-23 17:18:28.835 DEBUG 97383 --- [           main] 
o.a.camel.spring.boot.RoutesCollector    : Injecting following route into the 
CamelContext: Routes: 
[Route(route1)[[From[rest:get:/openapi.json?description=Returns+the+OpenAPI+specification+for+this+service&componentName=servlet]]
 -> [SetHeader[Content-Type, constant{application/vnd.oai.openapi+json}], 
SetBody[constant{resource:classpath:openapi.json}]]]]
2021-02-23 17:18:28.835 DEBUG 97383 --- [           main] 
o.a.camel.spring.boot.RoutesCollector    : Java RoutesBuilder: 
io/syndesis/example/RestRoute accepted by include/exclude filter: true
2021-02-23 17:18:28.835 DEBUG 97383 --- [           main] 
o.a.camel.spring.boot.RoutesCollector    : Injecting following route into the 
CamelContext: Routes: 
[Route(route2)[[From[rest:get:/api:/{id}?produces=application%2Fjson&description=Fetches+task+by+given+identifier&componentName=servlet]]
 -> [To[direct:79aeded8-c57a-4403-bdc4-5838678bf503]]]]
...
{code}

in this particular case, it results with an Exception due to multiple consumer 
on the same route. [~ffang] what do you think?

> should consider multiple ApplicationContext instances when specifying another 
> management.server.port
> ----------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-16063
>                 URL: https://issues.apache.org/jira/browse/CAMEL-16063
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-spring-boot
>            Reporter: Freeman Yue Fang
>            Assignee: Freeman Yue Fang
>            Priority: Major
>             Fix For: 3.7.1, 2.25.4
>
>         Attachments: camel-springboot-example.tar
>
>
> As the attached reproducer, when the SB camel application has another 
> management.server.port specified, not all camel routes from the 
> classpath(xml, java) can be collected.
> The output is like 
> {code}
> 2021-01-19 13:43:25.932  INFO 61489 --- [1 - timer://foo] hello from Java DSL 
>                      : Exchange[ExchangePattern: InOnly, BodyType: null, 
> Body: [Body is null]]
> 2021-01-19 13:43:25.933  INFO 61489 --- [1 - timer://foo] hello from Camel 
> XML                     : Exchange[ExchangePattern: InOnly, BodyType: null, 
> Body: [Body is null]]
> 2021-01-19 13:43:25.933  INFO 61489 --- [1 - timer://foo] hello from Spring 
> XML                    : Exchange[ExchangePattern: InOnly, BodyType: null, 
> Body: [Body is null]]
> {code}
> if no management.server.port specified. Otherwise, if management.server.port 
> specified for spring-boot-acturator, then the output is like
> {code}
> 2021-01-19 13:19:38.236  INFO 61101 --- [1 - timer://foo] hello from Spring 
> XML                    : Exchange[ExchangePattern: InOnly, BodyType: null, 
> Body: [Body is null]]
> 2021-01-19 13:19:39.227  INFO 61101 --- [1 - timer://foo] hello from Spring 
> XML                    : Exchange[ExchangePattern: InOnly, BodyType: null, 
> Body: [Body is null]]
> 2021-01-19 13:19:40.228  INFO 61101 --- [1 - timer://foo] hello from Spring 
> XML                    : Exchange[ExchangePattern: InOnly, BodyType: null, 
> Body: [Body is null]]
> 2021-01-19 13:19:41.228  INFO 61101 --- [1 - timer://foo] hello from Spring 
> XML                    : Exchange[ExchangePattern: InOnly, BodyType: null, 
> Body: [Body is null]]
> 2021-01-19 13:19:42.227  INFO 61101 --- [1 - timer://foo] hello from Spring 
> XML                    : Exchange[ExchangePattern: InOnly, BodyType: null, 
> Body: [Body is null]]
> {code}
> Camel route from classpath not collected



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to