You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2011/08/03 10:39:27 UTC

[jira] [Created] (CAMEL-4298) Add back ExecutorServiceStrategy and mark it as @deprecated

Add back ExecutorServiceStrategy and mark it as @deprecated
-----------------------------------------------------------

                 Key: CAMEL-4298
                 URL: https://issues.apache.org/jira/browse/CAMEL-4298
             Project: Camel
          Issue Type: Task
          Components: camel-core
            Reporter: Claus Ibsen
            Assignee: Christian Schneider
             Fix For: 2.9.0


The old ExecutorServiceStrategy was refacted into ExecutorServiceManager. But it was removed. This was a mistake as it breaks backwards compatibility, and people are not given a reasonable time to adjust.

So we should add back the ExecutorServiceStrategy and have it marked as @deprecated. It can then just under the hood, use the ExecutorServiceManager.

Then in a future Camel release we can removed the @deprecated ExecutorServiceStrategy (for example Camel 3.0, or in eg 1 year from now)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (CAMEL-4298) Add back ExecutorServiceStrategy and mark it as @deprecated

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

Claus Ibsen reassigned CAMEL-4298:
----------------------------------

    Assignee: Claus Ibsen  (was: Christian Schneider)

> Add back ExecutorServiceStrategy and mark it as @deprecated
> -----------------------------------------------------------
>
>                 Key: CAMEL-4298
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4298
>             Project: Camel
>          Issue Type: Task
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 2.9.0
>
>
> The old ExecutorServiceStrategy was refacted into ExecutorServiceManager. But it was removed. This was a mistake as it breaks backwards compatibility, and people are not given a reasonable time to adjust.
> So we should add back the ExecutorServiceStrategy and have it marked as @deprecated. It can then just under the hood, use the ExecutorServiceManager.
> Then in a future Camel release we can removed the @deprecated ExecutorServiceStrategy (for example Camel 3.0, or in eg 1 year from now)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (CAMEL-4298) Add back ExecutorServiceStrategy and mark it as @deprecated

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

Claus Ibsen resolved CAMEL-4298.
--------------------------------

    Resolution: Fixed

Added back the ExecutorServiceStrategy interface, and a delegate implementation that uses the new ExecutorServiceManager. Added the old unit test to ensure the strategy still works as expected.

Updated the wiki documentation as well.

> Add back ExecutorServiceStrategy and mark it as @deprecated
> -----------------------------------------------------------
>
>                 Key: CAMEL-4298
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4298
>             Project: Camel
>          Issue Type: Task
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 2.9.0
>
>
> The old ExecutorServiceStrategy was refacted into ExecutorServiceManager. But it was removed. This was a mistake as it breaks backwards compatibility, and people are not given a reasonable time to adjust.
> So we should add back the ExecutorServiceStrategy and have it marked as @deprecated. It can then just under the hood, use the ExecutorServiceManager.
> Then in a future Camel release we can removed the @deprecated ExecutorServiceStrategy (for example Camel 3.0, or in eg 1 year from now)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAMEL-4298) Add back ExecutorServiceStrategy and mark it as @deprecated

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

Claus Ibsen commented on CAMEL-4298:
------------------------------------

We should not pull the rug under Camel end users. We should allow them amble time to migrate from @deprecated APIs to its replacement.

The ExecutorServiceStrategy/ExecutorServiceManagement is in fact used also by Camel components such as:
- camel-stream
- camel-routebox
- camel-netty
- camel-mina
- camel-kestrel
- camel-jms
- camel-hdfs
- camel-hazelcast

Its not so uncommon to need a background task to run, or a scheduled task to run every X etc. For that people would have to use the ExecutorService.

By using the Camel ExecutorServiceStrategy/Management, we tell the users, that they get as a bonus, the thread pool enlisted/management in JMX, they get thread names that are human readable, and Camel ensures the thread pool lifecycle as well etc. 

So if we pull the rug, then people will discourage using the API from Camel and go back and use the Executors API from the JDK. This would be a shame, as then end users cannot have human readable thread names, and all their threads pools listed in JMX etc.

Besides the old API was designed to resemble the API from the JDK, such as the Executors and ThreadPoolExecutor.
http://download.oracle.com/javase/6/docs/api/java/util/concurrent/Executors.html
http://download.oracle.com/javase/6/docs/api/java/util/concurrent/ThreadPoolExecutor.html

With the new API that resemble is gone, and end users know need to understand the ThreadPoolBuilder. So the API changes may in fact not be that well thought.

I frankly like when you can do a one liner (without any extra Camel imports)
{code}
 this.executor = getCamelContext().getExecutorServiceStrategy().newSingleThreadExecutor(this, "MyTask");
{code}

That is no longer possible with the new API as you must use the ThreadPoolBuilder and this need to add that as an import. 



Likewise one of the recent developed 3rd party Camel component uses the ExecutorServiceStrategy
http://code.google.com/p/oracle-coherence-camel-component/
And I am sure there are more components out there using that.

I suggest to put back the ExecutorServiceStrategy interface. For its implementation you just delegate to the new ExecutorServiceManager. That would in fact also be a testimony that the new API covers all the old uses cases.


> Add back ExecutorServiceStrategy and mark it as @deprecated
> -----------------------------------------------------------
>
>                 Key: CAMEL-4298
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4298
>             Project: Camel
>          Issue Type: Task
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Assignee: Christian Schneider
>             Fix For: 2.9.0
>
>
> The old ExecutorServiceStrategy was refacted into ExecutorServiceManager. But it was removed. This was a mistake as it breaks backwards compatibility, and people are not given a reasonable time to adjust.
> So we should add back the ExecutorServiceStrategy and have it marked as @deprecated. It can then just under the hood, use the ExecutorServiceManager.
> Then in a future Camel release we can removed the @deprecated ExecutorServiceStrategy (for example Camel 3.0, or in eg 1 year from now)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAMEL-4298) Add back ExecutorServiceStrategy and mark it as @deprecated

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

Claus Ibsen commented on CAMEL-4298:
------------------------------------

There is now a problem in camel-jms as it used the ExecutorServiceStrategy to create a cached thread pool. This is no longer possible. I added a TODO in the camel-jms module.

But we may want to consider these API changes again. IMHO its better to have the API resemble what people already know from the JDK API. Alternative we may have some builder method on thread pool profile, so you can ask it to create a cached thread pool.

> Add back ExecutorServiceStrategy and mark it as @deprecated
> -----------------------------------------------------------
>
>                 Key: CAMEL-4298
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4298
>             Project: Camel
>          Issue Type: Task
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Assignee: Christian Schneider
>             Fix For: 2.9.0
>
>
> The old ExecutorServiceStrategy was refacted into ExecutorServiceManager. But it was removed. This was a mistake as it breaks backwards compatibility, and people are not given a reasonable time to adjust.
> So we should add back the ExecutorServiceStrategy and have it marked as @deprecated. It can then just under the hood, use the ExecutorServiceManager.
> Then in a future Camel release we can removed the @deprecated ExecutorServiceStrategy (for example Camel 3.0, or in eg 1 year from now)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAMEL-4298) Add back ExecutorServiceStrategy and mark it as @deprecated

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

Christian Schneider commented on CAMEL-4298:
--------------------------------------------

This was intentional as I think the change is not very difficult to follow and mainly hits component developers. I think we should remove the Strategy now or in the next minor release.

> Add back ExecutorServiceStrategy and mark it as @deprecated
> -----------------------------------------------------------
>
>                 Key: CAMEL-4298
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4298
>             Project: Camel
>          Issue Type: Task
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Assignee: Christian Schneider
>             Fix For: 2.9.0
>
>
> The old ExecutorServiceStrategy was refacted into ExecutorServiceManager. But it was removed. This was a mistake as it breaks backwards compatibility, and people are not given a reasonable time to adjust.
> So we should add back the ExecutorServiceStrategy and have it marked as @deprecated. It can then just under the hood, use the ExecutorServiceManager.
> Then in a future Camel release we can removed the @deprecated ExecutorServiceStrategy (for example Camel 3.0, or in eg 1 year from now)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAMEL-4298) Add back ExecutorServiceStrategy and mark it as @deprecated

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

Claus Ibsen commented on CAMEL-4298:
------------------------------------

See post on dev forum
http://camel.465427.n5.nabble.com/HEADS-UP-Adjustments-to-ExecutorServiceManager-on-trunk-tp4693698p4693698.html

> Add back ExecutorServiceStrategy and mark it as @deprecated
> -----------------------------------------------------------
>
>                 Key: CAMEL-4298
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4298
>             Project: Camel
>          Issue Type: Task
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 2.9.0
>
>
> The old ExecutorServiceStrategy was refacted into ExecutorServiceManager. But it was removed. This was a mistake as it breaks backwards compatibility, and people are not given a reasonable time to adjust.
> So we should add back the ExecutorServiceStrategy and have it marked as @deprecated. It can then just under the hood, use the ExecutorServiceManager.
> Then in a future Camel release we can removed the @deprecated ExecutorServiceStrategy (for example Camel 3.0, or in eg 1 year from now)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAMEL-4298) Add back ExecutorServiceStrategy and mark it as @deprecated

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

Claus Ibsen commented on CAMEL-4298:
------------------------------------

CAMEL-4244 introduced a few other issues so I am going to bridge back parts of the old API. As well to have better API documentation as the current dont have, so end user would not understand whats the difference between among others the following methods etc.
{code}
    ExecutorService getDefaultExecutorService(String ref, Object source);

    ExecutorService getExecutorService(ThreadPoolProfile profile, Object source);
    
    ExecutorService createExecutorService(ThreadPoolProfile profile, Object source);
{code}

> Add back ExecutorServiceStrategy and mark it as @deprecated
> -----------------------------------------------------------
>
>                 Key: CAMEL-4298
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4298
>             Project: Camel
>          Issue Type: Task
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 2.9.0
>
>
> The old ExecutorServiceStrategy was refacted into ExecutorServiceManager. But it was removed. This was a mistake as it breaks backwards compatibility, and people are not given a reasonable time to adjust.
> So we should add back the ExecutorServiceStrategy and have it marked as @deprecated. It can then just under the hood, use the ExecutorServiceManager.
> Then in a future Camel release we can removed the @deprecated ExecutorServiceStrategy (for example Camel 3.0, or in eg 1 year from now)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira