@ExcludeRoutes not working

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

@ExcludeRoutes not working

Louis Becker
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>



Reply | Threaded
Open this post in threaded view
|

RE: @ExcludeRoutes not working

Louis Becker
Hi

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

Louis

-----Original Message-----
From: Louis Becker [mailto:[hidden email]]
Sent: 13 February 2019 14:30
To: [hidden email]
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>







Reply | Threaded
Open this post in threaded view
|

Re: @ExcludeRoutes not working

Claus Ibsen-2
In reply to this post by Louis Becker
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 <[hidden email]> 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 | Threaded
Open this post in threaded view
|

RE: @ExcludeRoutes not working

Louis Becker
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:[hidden email]]
Sent: 14 February 2019 06:41
To: [hidden email]
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 <[hidden email]> 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



logfile.txt (289K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: @ExcludeRoutes not working

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

-----Original Message-----
From: Louis Becker [mailto:[hidden email]]
Sent: 15 February 2019 13:49
To: [hidden email]
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:[hidden email]]
Sent: 14 February 2019 06:41
To: [hidden email]
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 <[hidden email]> 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 | Threaded
Open this post in threaded view
|

Re: @ExcludeRoutes not working

Claus Ibsen-2
In reply to this post by Louis Becker
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 <[hidden email]> 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 | Threaded
Open this post in threaded view
|

Re: @ExcludeRoutes not working

Claus Ibsen-2
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 <[hidden email]> 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 <[hidden email]> 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
Reply | Threaded
Open this post in threaded view
|

Re: @ExcludeRoutes not working

Claus Ibsen-2
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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
Reply | Threaded
Open this post in threaded view
|

RE: @ExcludeRoutes not working

Louis Becker
Hi Claus

Thank you for your feedback.

Louis

-----Original Message-----
From: Claus Ibsen [mailto:[hidden email]]
Sent: 17 February 2019 11:52 AM
To: [hidden email]
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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