You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Freeman Fang (JIRA)" <ji...@apache.org> on 2009/03/04 10:51:56 UTC

[jira] Updated: (CXF-2082) client using decoupled ws-addressing with async handler hang from time to time

     [ https://issues.apache.org/jira/browse/CXF-2082?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Freeman Fang updated CXF-2082:
------------------------------

    Description: 
If we use decoupled ws-addressing and async invaction handler, client side will hang from time to time. At the same time we can see some error like "Connection reset by peer".
The fix is in HTTPConduit, we should cache the InputStream of inMessage before invoke the clientImpl.onMessage, since for async mode, the onMessage is in anonther thead and executing by executor, we can't guarantee the connection still alive when onMessage really invoked.
So we need do like
{code}
                InputStream in = inMessage.getContent(InputStream.class);
                CachedOutputStream cos = new CachedOutputStream();
                IOUtils.copy(in, cos);
                inMessage.setContent(InputStream.class, cos.getInputStream());
                incomingObserver.onMessage(inMessage);
{code}
to cache the inputstream to ensure it's still there when we use it.

  was:
If we use decoupled ws-addressing and async invaction handler, client side will hang from time to time. At the same time we can see some error like "Connection reset by peer".
The fix is in HTTPConduit, we should cache the InputStream of inMessage before invoke the clientImpl.onMessage, since for async mode, the onMessage is in anonther thead and executing by executor, we can't guarantee the connection still alive when onMessage really invoked.
So we need do like
{code}
                InputStream in = inMessage.getContent(InputStream.class);
                CachedOutputStream cos = new CachedOutputStream();
                IOUtils.copy(in, cos);
                inMessage.setContent(InputStream.class, cos.getInputStream());
                incomingObserver.onMessage(inMessage);
{code}
to cache the inputstream to ensure there are still there when we use it.


> client using decoupled ws-addressing with async handler hang from time to time
> ------------------------------------------------------------------------------
>
>                 Key: CXF-2082
>                 URL: https://issues.apache.org/jira/browse/CXF-2082
>             Project: CXF
>          Issue Type: Bug
>            Reporter: Freeman Fang
>            Assignee: Freeman Fang
>             Fix For: 2.2, 2.0.11, 2.1.5
>
>
> If we use decoupled ws-addressing and async invaction handler, client side will hang from time to time. At the same time we can see some error like "Connection reset by peer".
> The fix is in HTTPConduit, we should cache the InputStream of inMessage before invoke the clientImpl.onMessage, since for async mode, the onMessage is in anonther thead and executing by executor, we can't guarantee the connection still alive when onMessage really invoked.
> So we need do like
> {code}
>                 InputStream in = inMessage.getContent(InputStream.class);
>                 CachedOutputStream cos = new CachedOutputStream();
>                 IOUtils.copy(in, cos);
>                 inMessage.setContent(InputStream.class, cos.getInputStream());
>                 incomingObserver.onMessage(inMessage);
> {code}
> to cache the inputstream to ensure it's still there when we use it.

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