You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Vitalii Tymchyshyn (JIRA)" <ji...@apache.org> on 2013/05/27 10:49:21 UTC

[jira] [Commented] (CAMEL-6390) Route with suspended SedaConsumer can't be stopped correctly

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

Vitalii Tymchyshyn commented on CAMEL-6390:
-------------------------------------------

It does not work. Original test does not send any message.
Your test also does not work if it either: 
1) Does not send any message
2) Sleep 2000ms after suspension. (that is better as "do not send" works on some timing clash, see below)

To be clear:
a) 2000ms is used since default poll timeout is 1000ms. For real test, poll timeout can be lowered down and sleep after suspension used.
b) you test works because it does not have time to exit from queue.pool to really suspend polling thread. 
c) The actual problem is that SedaConsumer first check isSuspending/isSuspended and go for next circle if it is. Shutdown check is done later (after queue.poll), so when suspended it never reaches this shutdown check.
                
>  Route with suspended SedaConsumer can't be stopped correctly
> -------------------------------------------------------------
>
>                 Key: CAMEL-6390
>                 URL: https://issues.apache.org/jira/browse/CAMEL-6390
>             Project: Camel
>          Issue Type: Bug
>    Affects Versions: 2.10.0
>            Reporter: Vitalii Tymchyshyn
>            Assignee: Claus Ibsen
>             Fix For: 2.11.1
>
>
> Route with suspended SedaConsumer can't be stopped correctly. Here is test:
> {code}
>  @Test
>     public void testOriginalSedaShutdownSuspended() throws Exception {
>         SedaEndpoint endpoint = context().getEndpoint("seda:test", SedaEndpoint.class);
>         context().addRouteDefinition(new RouteDefinition()
>                 .id("testRoute")
>                 .from(endpoint)
>                 .to("log:body")
>         );
>         Set<SedaConsumer> consumers = endpoint.getConsumers();
>         Assert.assertFalse(consumers.isEmpty());
>         for (SedaConsumer sedaConsumer: consumers) {
>             sedaConsumer.suspend();
>         }
>         Assert.assertTrue(context().stopRoute("testRoute", 2, TimeUnit.SECONDS, true));
>     }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira