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 there are 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.