[ 
https://issues.apache.org/jira/browse/CXF-1283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12550353
 ] 

Jervis Liu commented on CXF-1283:
---------------------------------

sth like below should work. I.e., in the Runnable, set a FINISHED flag once it 
is done.
   
 private void waitResponse(Exchange exchange) {
        int remaining = synchronousTimeout;
        while (!Boolean.TRUE.equals(exchange.get(FINISHED)) && remaining > 0) {
            long start = System.currentTimeMillis();
            try {
                exchange.wait(remaining);
            } catch (InterruptedException ex) {
                // ignore
            }
            long end = System.currentTimeMillis();
            remaining -= (int)(end - start);
        }
        if (!Boolean.TRUE.equals(exchange.get(FINISHED))) {
            LogUtils.log(LOG, Level.WARNING, "RESPONSE_TIMEOUT",
                exchange.get(OperationInfo.class).getName().toString());
        }
    }

> Forking another thread to invoke the service implementation in 
> ServiceInvokerInterceptor is not working
> -------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-1283
>                 URL: https://issues.apache.org/jira/browse/CXF-1283
>             Project: CXF
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0, 2.0.1, 2.0.2, 2.0.3
>            Reporter: willem Jiang
>             Fix For: 2.0.4, 2.1
>
>
> I just did a test of using the separated thread pool for the servant 
> execution, the test was failed. 
> It is because CXF OutgoingChainInterceptor and ServiceInvokerInterceptor are 
> invoked in the same thread, 
> if we fork another thread to invoke the servant,  the original thread will 
> not wait for the response message 
> and keep on calling the OutgoingChainInterceptor and the 
> OutgoingChainInterceptor can't get the outMessage
>  from the exchange the output stream will be closed. The client side will not 
> get the expected message then.

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

Reply via email to