You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Willem Jiang (JIRA)" <ji...@apache.org> on 2010/09/28 12:12:40 UTC

[jira] Created: (CAMEL-3169) Add continuation synchronize block to avoid the CamelAsync API return earlier then the interceptor chain is suspend

Add continuation synchronize block to avoid the CamelAsync API return earlier then the interceptor chain is suspend  
---------------------------------------------------------------------------------------------------------------------

                 Key: CAMEL-3169
                 URL: https://issues.apache.org/activemq/browse/CAMEL-3169
             Project: Apache Camel
          Issue Type: Improvement
          Components: camel-cxf
            Reporter: Willem Jiang
            Assignee: Willem Jiang
             Fix For: 2.5.0


As the CamelAsyncProcess always takes some time to do it job, we barely hit the upper situation, but it still has chance to hit this situation.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-3169) Add continuation synchronize block to avoid the CamelAsync API return earlier then the interceptor chain is suspend

Posted by "Martin Krasser (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-3169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=62192#action_62192 ] 

Martin Krasser commented on CAMEL-3169:
---------------------------------------

Hi Martin

{quote}
As CXF 2.2.x is using Jetty6 style continuation, and the camel-jetty is using Jetty7, we are facing different continuation implementation.
in CXF 2.2.x, you need to call the AsyncProcess process API before call the suspend, so the continuation.resume() could be called before continuation.suspend().
{quote}

ah, just looked at the jetty 6 docs (and also a CXF continuation example), they're using exclusive locks. Not sure if it is used only by this example or if it is required in general. Will dig in further when I find some time. Or do you have a link to documentation that is more clear about that?

{quote}
And the AsyncCallback done() is called always after the suspend, I don't think CamelContinuationServlet will have the issue that CXF continuation is faced.
{quote}

Not in the version that I linked before because that's the fixed version of the CamelContinuationServlet. The issue was in Camel 2.4.0

https://svn.apache.org/repos/asf/camel/tags/camel-2.4.0/components/camel-jetty/src/main/java/org/apache/camel/component/jetty/CamelContinuationServlet.java

See also CAMEL-2986


> Add continuation synchronize block to avoid the CamelAsync API return earlier then the interceptor chain is suspend  
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-3169
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3169
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-cxf
>            Reporter: Willem Jiang
>            Assignee: Willem Jiang
>             Fix For: 2.5.0
>
>
> As the CamelAsyncProcess always takes some time to do it job, we barely hit the upper situation, but it still has chance to hit this situation.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-3169) Add continuation synchronize block to avoid the CamelAsync API return earlier then the interceptor chain is suspend

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-3169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=62190#action_62190 ] 

Willem Jiang commented on CAMEL-3169:
-------------------------------------

Hi Martin

As CXF 2.2.x is using Jetty6 style continuation, and the camel-jetty is using Jetty7, we are facing different continuation implementation.
in CXF 2.2.x, you need to call the AsyncProcess process API before call the suspend, so the continuation.resume() could be called before continuation.suspend().
And the AsyncCallback done() is called always after the suspend, I don't think CamelContinuationServlet will have the issue that CXF continuation is faced.


> Add continuation synchronize block to avoid the CamelAsync API return earlier then the interceptor chain is suspend  
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-3169
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3169
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-cxf
>            Reporter: Willem Jiang
>            Assignee: Willem Jiang
>             Fix For: 2.5.0
>
>
> As the CamelAsyncProcess always takes some time to do it job, we barely hit the upper situation, but it still has chance to hit this situation.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CAMEL-3169) Add continuation synchronize block to avoid the CamelAsync API return earlier then the interceptor chain is suspend

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

Willem Jiang resolved CAMEL-3169.
---------------------------------

    Resolution: Fixed

Applied the patch in revision #1002095.

> Add continuation synchronize block to avoid the CamelAsync API return earlier then the interceptor chain is suspend  
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-3169
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3169
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-cxf
>            Reporter: Willem Jiang
>            Assignee: Willem Jiang
>             Fix For: 2.5.0
>
>
> As the CamelAsyncProcess always takes some time to do it job, we barely hit the upper situation, but it still has chance to hit this situation.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (CAMEL-3169) Add continuation synchronize block to avoid the CamelAsync API return earlier then the interceptor chain is suspend

Posted by "Martin Krasser (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-3169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=62192#action_62192 ] 

Martin Krasser edited comment on CAMEL-3169 at 9/28/10 8:27 AM:
----------------------------------------------------------------

{quote}
As CXF 2.2.x is using Jetty6 style continuation, and the camel-jetty is using Jetty7, we are facing different continuation implementation.
in CXF 2.2.x, you need to call the AsyncProcess process API before call the suspend, so the continuation.resume() could be called before continuation.suspend().
{quote}

ah, just looked at the jetty 6 docs (and also a CXF continuation example), they're using exclusive locks. Not sure if it is used only by this example or if it is required in general. Will dig in further when I find some time. Or do you have a link to documentation that is more clear about that?

{quote}
And the AsyncCallback done() is called always after the suspend, I don't think CamelContinuationServlet will have the issue that CXF continuation is faced.
{quote}

Not in the version that I linked before because that's the fixed version of the CamelContinuationServlet. The issue was in Camel 2.4.0

https://svn.apache.org/repos/asf/camel/tags/camel-2.4.0/components/camel-jetty/src/main/java/org/apache/camel/component/jetty/CamelContinuationServlet.java

See also CAMEL-2986


      was (Author: mrt1nz):
    Hi Martin

{quote}
As CXF 2.2.x is using Jetty6 style continuation, and the camel-jetty is using Jetty7, we are facing different continuation implementation.
in CXF 2.2.x, you need to call the AsyncProcess process API before call the suspend, so the continuation.resume() could be called before continuation.suspend().
{quote}

ah, just looked at the jetty 6 docs (and also a CXF continuation example), they're using exclusive locks. Not sure if it is used only by this example or if it is required in general. Will dig in further when I find some time. Or do you have a link to documentation that is more clear about that?

{quote}
And the AsyncCallback done() is called always after the suspend, I don't think CamelContinuationServlet will have the issue that CXF continuation is faced.
{quote}

Not in the version that I linked before because that's the fixed version of the CamelContinuationServlet. The issue was in Camel 2.4.0

https://svn.apache.org/repos/asf/camel/tags/camel-2.4.0/components/camel-jetty/src/main/java/org/apache/camel/component/jetty/CamelContinuationServlet.java

See also CAMEL-2986

  
> Add continuation synchronize block to avoid the CamelAsync API return earlier then the interceptor chain is suspend  
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-3169
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3169
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-cxf
>            Reporter: Willem Jiang
>            Assignee: Willem Jiang
>             Fix For: 2.5.0
>
>
> As the CamelAsyncProcess always takes some time to do it job, we barely hit the upper situation, but it still has chance to hit this situation.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-3169) Add continuation synchronize block to avoid the CamelAsync API return earlier then the interceptor chain is suspend

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-3169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=62193#action_62193 ] 

Willem Jiang commented on CAMEL-3169:
-------------------------------------

Hi Martin,

In Jetty6, the continuation suspend is implemented by throwing a runtime exception, so you need to set up the async call back before calling the continuation suspend.
In Jetty7, you can set up the async call back after calling the suspend method of continuation, and patch of CAMEL-2986 works perfect for you.

Because the continuation of CXF 2.2.x is based on thrown a runtime exception, I can't change the code as you do in CAMEL-2986.
I already did some work in CXF-2982[1],  and I will updated the camel-cxf code once upgrade CXF version to 2.3.0.  

[1]https://issues.apache.org/jira/browse/CXF-2982

Willem

> Add continuation synchronize block to avoid the CamelAsync API return earlier then the interceptor chain is suspend  
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-3169
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3169
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-cxf
>            Reporter: Willem Jiang
>            Assignee: Willem Jiang
>             Fix For: 2.5.0
>
>
> As the CamelAsyncProcess always takes some time to do it job, we barely hit the upper situation, but it still has chance to hit this situation.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-3169) Add continuation synchronize block to avoid the CamelAsync API return earlier then the interceptor chain is suspend

Posted by "Martin Krasser (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-3169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=62188#action_62188 ] 

Martin Krasser commented on CAMEL-3169:
---------------------------------------

Hi Willem,

I had a similar problem in the CamelContinuationServlet in camel-jetty and could solve it without using exclusive locks (i.e. synchronization). 

https://svn.apache.org/repos/asf/camel/trunk/components/camel-jetty/src/main/java/org/apache/camel/component/jetty/CamelContinuationServlet.java

I didn't investigate the CxfConsumer and CXF continuations in all details but I think the solution pattern from camel-jetty is also applicable here. Thoughts?



> Add continuation synchronize block to avoid the CamelAsync API return earlier then the interceptor chain is suspend  
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-3169
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3169
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-cxf
>            Reporter: Willem Jiang
>            Assignee: Willem Jiang
>             Fix For: 2.5.0
>
>
> As the CamelAsyncProcess always takes some time to do it job, we barely hit the upper situation, but it still has chance to hit this situation.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.