You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Louis Becker <LB...@meatco.com.na> on 2019/02/13 12:30:11 UTC

@ExcludeRoutes not working

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>




RE: @ExcludeRoutes not working

Posted by Louis Becker <LB...@meatco.com.na>.
Hi

I am trying to "suppress" noisy routes! Sorry about the typo.

Louis

-----Original Message-----
From: Louis Becker [mailto:LBecker@meatco.com.na] 
Sent: 13 February 2019 14:30
To: users@camel.apache.org
Subject: @ExcludeRoutes not working

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>








RE: @ExcludeRoutes not working

Posted by Louis Becker <LB...@meatco.com.na>.
Hi Claus

Thank you for your feedback.

Louis

-----Original Message-----
From: Claus Ibsen [mailto:claus.ibsen@gmail.com] 
Sent: 17 February 2019 11:52 AM
To: users@camel.apache.org
Subject: Re: @ExcludeRoutes not working

Hi

I logged a ticket and added support for using @ExcludeRoutes in Camel
2.24 and 3.0 onwards
https://issues.apache.org/jira/browse/CAMEL-13210

On Sun, Feb 17, 2019 at 9:59 AM Claus Ibsen <cl...@gmail.com> wrote:
>
> Hi
>
> There is also a little example here
> https://github.com/camelinaction/camelinaction2/tree/master/chapter9/s
> pring-boot-test-one-route
>
> On Sun, Feb 17, 2019 at 9:54 AM Claus Ibsen <cl...@gmail.com> wrote:
> >
> > Hi
> >
> > Okay so that annotation @ExcludeRoutes is for non spring boot 
> > testing (eg old school spring apps).
> >
> > For spring-boot you need to use the java-routes-include-pattern and 
> > java-routes-exclude-pattern properties.
> >
> > These are documented a bit at
> > https://github.com/apache/camel/blob/master/components/camel-spring-
> > boot/src/main/docs/spring-boot.adoc
> >
> > On Wed, Feb 13, 2019 at 1:30 PM Louis Becker <LB...@meatco.com.na> 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
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2



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



Re: @ExcludeRoutes not working

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

I logged a ticket and added support for using @ExcludeRoutes in Camel
2.24 and 3.0 onwards
https://issues.apache.org/jira/browse/CAMEL-13210

On Sun, Feb 17, 2019 at 9:59 AM Claus Ibsen <cl...@gmail.com> wrote:
>
> Hi
>
> There is also a little example here
> https://github.com/camelinaction/camelinaction2/tree/master/chapter9/spring-boot-test-one-route
>
> On Sun, Feb 17, 2019 at 9:54 AM Claus Ibsen <cl...@gmail.com> wrote:
> >
> > Hi
> >
> > Okay so that annotation @ExcludeRoutes is for non spring boot testing
> > (eg old school spring apps).
> >
> > For spring-boot you need to use the java-routes-include-pattern and
> > java-routes-exclude-pattern
> > properties.
> >
> > These are documented a bit at
> > https://github.com/apache/camel/blob/master/components/camel-spring-boot/src/main/docs/spring-boot.adoc
> >
> > On Wed, Feb 13, 2019 at 1:30 PM Louis Becker <LB...@meatco.com.na> 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
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2



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

Re: @ExcludeRoutes not working

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

There is also a little example here
https://github.com/camelinaction/camelinaction2/tree/master/chapter9/spring-boot-test-one-route

On Sun, Feb 17, 2019 at 9:54 AM Claus Ibsen <cl...@gmail.com> wrote:
>
> Hi
>
> Okay so that annotation @ExcludeRoutes is for non spring boot testing
> (eg old school spring apps).
>
> For spring-boot you need to use the java-routes-include-pattern and
> java-routes-exclude-pattern
> properties.
>
> These are documented a bit at
> https://github.com/apache/camel/blob/master/components/camel-spring-boot/src/main/docs/spring-boot.adoc
>
> On Wed, Feb 13, 2019 at 1:30 PM Louis Becker <LB...@meatco.com.na> 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



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

Re: @ExcludeRoutes not working

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Okay so that annotation @ExcludeRoutes is for non spring boot testing
(eg old school spring apps).

For spring-boot you need to use the java-routes-include-pattern and
java-routes-exclude-pattern
properties.

These are documented a bit at
https://github.com/apache/camel/blob/master/components/camel-spring-boot/src/main/docs/spring-boot.adoc

On Wed, Feb 13, 2019 at 1:30 PM Louis Becker <LB...@meatco.com.na> 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

RE: @ExcludeRoutes not working

Posted by Louis Becker <LB...@meatco.com.na>.
It is as if the RoutesCollector DO NOT get the info included in @ExcludeRoutes annotation.

-----Original Message-----
From: Louis Becker [mailto:LBecker@meatco.com.na] 
Sent: 15 February 2019 13:49
To: users@camel.apache.org
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:claus.ibsen@gmail.com] 
Sent: 14 February 2019 06:41
To: users@camel.apache.org
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 <LB...@meatco.com.na> 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



RE: @ExcludeRoutes not working

Posted by Louis Becker <LB...@meatco.com.na>.
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:claus.ibsen@gmail.com] 
Sent: 14 February 2019 06:41
To: users@camel.apache.org
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 <LB...@meatco.com.na> 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



Re: @ExcludeRoutes not working

Posted by Claus Ibsen <cl...@gmail.com>.
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 <LB...@meatco.com.na> 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