It is as if the RoutesCollector DO NOT get the info included in @ExcludeRoutes 
annotation.

-----Original Message-----
From: Louis Becker [mailto:[email protected]] 
Sent: 15 February 2019 13:49
To: [email protected]
Subject: RE: @ExcludeRoutes not working

Dear Claus

Thank you for your response.

I have now enable DEBUG logging and can see in detail how the routes are 
loaded. It is as if the RoutesBuilder get the info included in @ExcludeRoutes 
annotation.

I have included the log file for your perusal. Routes start to load around line 
55.

Your help will be much appreciated.

Regards



-----Original Message-----
From: Claus Ibsen [mailto:[email protected]] 
Sent: 14 February 2019 06:41
To: [email protected]
Subject: Re: @ExcludeRoutes not working

Hi

How are all these routes registered with your spring application? Are you for 
example using @Component or something.
Try setting up DEBUG logging on org.apache.camel.test.spring and see what is 
outputted, as that is where the logic for exclude routes is.


On Wed, Feb 13, 2019 at 1:30 PM Louis Becker <[email protected]> wrote:
>
> Hi
>
> I am developing a camel 2.22.1 in spring using spring boot 2.0.7.
>
> I am trying to surprise "noisy" routes during testing, but it seems like my 
> @ExcludeRoutes array of classes is being ignored. I expect only on route to 
> run (see <code>), but as you will see from the extract from the <log> that 
> many of the listed routes still run.
>
> Can someone tell me what I should be doing differently? Google did not help.
>
> Regards
> Louis
>
> <code>
>
> @Slf4j
> @ActiveProfiles("mock")
> @RunWith(CamelSpringBootRunner.class)
> @SpringBootTest
> @DirtiesContext(classMode = 
> DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)
> @MockEndpoints
> @ExcludeRoutes({
>         EmydexSalesOrderOutputRoute.class,
>         SageX3SalesInvoiceInputRoute.class,
>         SageX3SalesOrderOutputRoute.class,
>         SalesInvoiceRouter.class,
>         SalesOrderRouter.class,
>         SavePrettyXmlRoute.class,
>         UpdateSageX3InvoiceSentStatusRoute.class,
>         WoermannSalesInvoiceOutputRoute.class,
>         WoermannSalesInvoiceOutputRoute.class,
>         WoermannSalesOrderInputRoute.class})
> public class PriceListOutputRouteMockTest {
>
> </code>
>
> <log>
> 2019-02-13 14:23:09.135  INFO 13240 --- [           main] 
> o.a.camel.spring.SpringCamelContext      : Route: route1 started and 
> consuming from: direct://emydexSalesOrderOutputRouteInput
> 2019-02-13 14:23:09.135  INFO 13240 --- [           main] 
> o.a.camel.spring.SpringCamelContext      : Route: route2 started and 
> consuming from: direct://priceListOutputRouteInput
> 2019-02-13 14:23:09.135  INFO 13240 --- [           main] 
> o.a.camel.spring.SpringCamelContext      : Route: route3 started and 
> consuming from: direct://sageX3SalesInvoiceInputRouteInput
> 2019-02-13 14:23:09.135  INFO 13240 --- [           main] 
> o.a.camel.spring.SpringCamelContext      : Route: route4 started and 
> consuming from: direct://sageX3SalesOrderOutputRouteInput
> 2019-02-13 14:23:09.150  INFO 13240 --- [           main] 
> o.a.camel.spring.SpringCamelContext      : Route: route5 started and 
> consuming from: direct://salesInvoiceRouterInput
> 2019-02-13 14:23:09.150  INFO 13240 --- [           main] 
> o.a.camel.spring.SpringCamelContext      : Route: route6 started and 
> consuming from: direct://salesOrderRouterInput
> 2019-02-13 14:23:09.150  INFO 13240 --- [           main] 
> o.a.camel.spring.SpringCamelContext      : Route: route7 started and 
> consuming from: direct://woermannCustomInvoiceSendRouteInput
> </log>
>
>
>


--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2


Reply via email to