Search code examples
wso2esbwso2-esb

wso2 esb cannot forward request to target server


I have ESB 4.8.1 running on Windows server. I created proxy which forward HTTP requests to IIS application. The end point is defined like below. Now ESB can connect to IIS well. Then IIS server is restarted, ESB cannot connect to IIS application anymore.

<endpoint xmlns="http://ws.apache.org/ns/synapse" name="abcServerEndpoint">
    <address uri="@ESB_ABC_SERVER_ENDPOINT@">
        <retryConfig>
          <disabledErrorCodes>101503,101507</disabledErrorCodes>
        </retryConfig>
       <timeout> 
               <duration>300000</duration> 
               <responseAction>fault</responseAction> 
           </timeout> 
           <suspendOnFailure> 
               <errorCodes>-1</errorCodes> 
               <initialDuration>0</initialDuration> 
               <progressionFactor>0.0</progressionFactor> 
               <maximumDuration>0</maximumDuration> 
           </suspendOnFailure> 
           <markForSuspension> 
               <errorCodes>-1</errorCodes> 
           </markForSuspension> 
    </address>
</endpoint>

The error log is like below 2016-01-20 17:52:08,050 [-] [HTTP-Listener I/O dispatcher-2] WARN SourceHandler Connection time out after request is read: http-incoming-174 2016-01-20 17:52:09,033 [-] [HTTP-Listener I/O dispatcher-1] WARN SourceHandler Connection time out after request is read: http-incoming-180 2016-01-20 17:52:09,033 [-] [HTTP-Listener I/O dispatcher-1] WARN SourceHandler Connection time out after request is read: http-incoming-177


Solution

  • WARN SourceHandler Connection time out after request is read: http-incoming-174 2016-01-20 17:52:09,033 [-]

    The reason for the above WARN log is that the connection between the client (in your scenario IIS server) and the ESB got timeout before ESB sends the response to the client.

    By default, this timeout is 60 seconds (the socket timeout of http listener). So ESB takes more than 60 seconds to send a response to IIS server. Cause for this issue could be due to a slow backend.

    As a solution you can increase this socket timeout of passthrough http transport by adding below property to passthru-http.properties file in $ESB_HOME/repository/conf/ directory.

    http.socket.timeout=120000
    

    Hope this information will help you.