You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Sergey Zhemzhitsky (Created) (JIRA)" <ji...@apache.org> on 2012/01/22 04:07:45 UTC

[jira] [Created] (CAMEL-4928) Async API support by the Timer component

Async API support by the Timer component
----------------------------------------

                 Key: CAMEL-4928
                 URL: https://issues.apache.org/jira/browse/CAMEL-4928
             Project: Camel
          Issue Type: Improvement
          Components: camel-core
    Affects Versions: 2.9.0
            Reporter: Sergey Zhemzhitsky


It would be great to have timer component support asynchronous API.
Such a feature can be useful when timer component generates events which must be processed by multiple threads. 
Current implementation of the timer component makes a blocking call so the usage of thread pools hardly possible to process multiple timer event simultaneously.

{code:title=Sample}
from("timer:start")
    .threads(1, 5)
    .to("bean:very-long-operation");
{code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAMEL-4928) Async API support by the Timer component

Posted by "Sergey Zhemzhitsky (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-4928?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13191382#comment-13191382 ] 

Sergey Zhemzhitsky commented on CAMEL-4928:
-------------------------------------------

I noticed that *synchronous=false* is used primarily by producers and *asyncConsumer* parameter exists only in jms consumer, so I suppose that *synchronous* parameter can be used to determine whether both producers or consumers should be synchronous. (Maybe jms consumer should consider using of *synchronous* parameter instead of *asyncConsumer* to prevent introduction of new parameters for the same thing in other components)

So, the patch was replaced to involve usage of *synchronous* parameter.
                
> Async API support by the Timer component
> ----------------------------------------
>
>                 Key: CAMEL-4928
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4928
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.9.0
>            Reporter: Sergey Zhemzhitsky
>              Labels: timer
>         Attachments: CAMEL-4928.patch
>
>
> It would be great to have timer component support asynchronous API.
> Such a feature can be useful when timer component generates events which must be processed by multiple threads. 
> Current implementation of the timer component makes a blocking call so the usage of thread pools hardly possible to process multiple timer event simultaneously.
> {code:title=Sample}
> from("timer:start")
>     .threads(1, 5)
>     .to("bean:very-long-operation");
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAMEL-4928) Async API support by the Timer component

Posted by "Sergey Zhemzhitsky (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-4928?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13190591#comment-13190591 ] 

Sergey Zhemzhitsky commented on CAMEL-4928:
-------------------------------------------

New _async_ parameter has been added in the included patch.

{code:title=Sample}
from("timer:start?async=true")
    .threads(1, 5)
    .to("bean:very-long-operation")
{code}

So by default the behavior is exactly the same as in the previous version of timer and if one want to use asynchronous API _async=true_ parameter should be added in the endpoint uri.

The patch also includes _doSuspend_ and _doResume_ methods in the TimerConsumer to be able to stop the route faster and to prevent the timer running during stopping the route when using async. api.
                
> Async API support by the Timer component
> ----------------------------------------
>
>                 Key: CAMEL-4928
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4928
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.9.0
>            Reporter: Sergey Zhemzhitsky
>              Labels: timer
>         Attachments: CAMEL-4928.patch
>
>
> It would be great to have timer component support asynchronous API.
> Such a feature can be useful when timer component generates events which must be processed by multiple threads. 
> Current implementation of the timer component makes a blocking call so the usage of thread pools hardly possible to process multiple timer event simultaneously.
> {code:title=Sample}
> from("timer:start")
>     .threads(1, 5)
>     .to("bean:very-long-operation");
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CAMEL-4928) Async API support by the Timer component

Posted by "Sergey Zhemzhitsky (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-4928?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sergey Zhemzhitsky updated CAMEL-4928:
--------------------------------------

    Attachment:     (was: CAMEL-4928.patch)
    
> Async API support by the Timer component
> ----------------------------------------
>
>                 Key: CAMEL-4928
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4928
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.9.0
>            Reporter: Sergey Zhemzhitsky
>              Labels: timer
>         Attachments: CAMEL-4928.patch
>
>
> It would be great to have timer component support asynchronous API.
> Such a feature can be useful when timer component generates events which must be processed by multiple threads. 
> Current implementation of the timer component makes a blocking call so the usage of thread pools hardly possible to process multiple timer event simultaneously.
> {code:title=Sample}
> from("timer:start")
>     .threads(1, 5)
>     .to("bean:very-long-operation");
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CAMEL-4928) Async API support by the Timer component

Posted by "Sergey Zhemzhitsky (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-4928?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sergey Zhemzhitsky updated CAMEL-4928:
--------------------------------------

    Attachment: CAMEL-4928.patch
    
> Async API support by the Timer component
> ----------------------------------------
>
>                 Key: CAMEL-4928
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4928
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.9.0
>            Reporter: Sergey Zhemzhitsky
>              Labels: timer
>         Attachments: CAMEL-4928.patch
>
>
> It would be great to have timer component support asynchronous API.
> Such a feature can be useful when timer component generates events which must be processed by multiple threads. 
> Current implementation of the timer component makes a blocking call so the usage of thread pools hardly possible to process multiple timer event simultaneously.
> {code:title=Sample}
> from("timer:start")
>     .threads(1, 5)
>     .to("bean:very-long-operation");
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CAMEL-4928) Async API support by the Timer component

Posted by "Sergey Zhemzhitsky (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-4928?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sergey Zhemzhitsky updated CAMEL-4928:
--------------------------------------

    Attachment: CAMEL-4928.patch
    
> Async API support by the Timer component
> ----------------------------------------
>
>                 Key: CAMEL-4928
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4928
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.9.0
>            Reporter: Sergey Zhemzhitsky
>              Labels: timer
>         Attachments: CAMEL-4928.patch, CAMEL-4928.patch
>
>
> It would be great to have timer component support asynchronous API.
> Such a feature can be useful when timer component generates events which must be processed by multiple threads. 
> Current implementation of the timer component makes a blocking call so the usage of thread pools hardly possible to process multiple timer event simultaneously.
> {code:title=Sample}
> from("timer:start")
>     .threads(1, 5)
>     .to("bean:very-long-operation");
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAMEL-4928) Async API support by the Timer component

Posted by "Claus Ibsen (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-4928?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13190648#comment-13190648 ] 

Claus Ibsen commented on CAMEL-4928:
------------------------------------

I think the consumers should use the Async API by default. People can disable async in their routes by setting synchronous=false, on the endpoint uri's if they want that disabled.

Or we could introduce asyncConsumer=true|false as a general option, for people to control this.

The JMS consumer already have the asyncConsumer option.
                
> Async API support by the Timer component
> ----------------------------------------
>
>                 Key: CAMEL-4928
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4928
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.9.0
>            Reporter: Sergey Zhemzhitsky
>              Labels: timer
>         Attachments: CAMEL-4928.patch
>
>
> It would be great to have timer component support asynchronous API.
> Such a feature can be useful when timer component generates events which must be processed by multiple threads. 
> Current implementation of the timer component makes a blocking call so the usage of thread pools hardly possible to process multiple timer event simultaneously.
> {code:title=Sample}
> from("timer:start")
>     .threads(1, 5)
>     .to("bean:very-long-operation");
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira