Question

configuration: WSO2ESB 4.8.0\4.8.1 OS: Linux\FreeBSD

CLIENT <-> ESB <-> BACKEND

here is my problem: if i create the simplest pass-through proxy to the sample service which responses with a delay of > 60 sec. i get an error when esb closes connection with the client without any response. By the way, according to the soap tracer logs ESB receives data from the backend, but connection "CLIENT <-> ESB" is already closed at that time.

i tried to set these values:

repository/conf/axis2/axis2_client.xml

    <transportSender name="http" class="org.apache.axis2.transport.http.CommonsHTTPTransportSender"
            (...)
            <parameter name="SO_TIMEOUT">120000</parameter>
            <parameter name="CONNECTION_TIMEOUT">120000</parameter>
        </transportSender>
        <transportSender name="https" class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
            (...)
            <parameter name="SO_TIMEOUT">120000</parameter>
            <parameter name="CONNECTION_TIMEOUT">120000</parameter>
        </transportSender>

repository/conf/nhttp.properties

http.socket.timeout=600000

repository/conf/axis2/axis2.xml

<transportReceiver name="http" class="org.apache.synapse.transport.nhttp.HttpCoreNIOListener">
      (...)
        <parameter name="SO_TIMEOUT" locked="false">120000</parameter>
        <parameter name="CONNECTION_TIMEOUT" locked="false">120000</parameter>
      (...)
    </transportReceiver>


    <transportReceiver name="https" class="org.apache.synapse.transport.nhttp.HttpCoreNIOSSLListener">
       (...)
        <parameter name="SO_TIMEOUT" locked="false">120000</parameter>
        <parameter name="CONNECTION_TIMEOUT" locked="false">120000</parameter>
        (...)
     </transportReceiver>


<transportSender name="http" class="org.apache.synapse.transport.nhttp.HttpCoreNIOSender">
        (...)
        <parameter name="SO_TIMEOUT" locked="false">120000</parameter>
        <parameter name="CONNECTION_TIMEOUT" locked="false">120000</parameter>

    </transportSender>
    <transportSender name="https" class="org.apache.synapse.transport.nhttp.HttpCoreNIOSSLSender">
            (...)
            <parameter name="SO_TIMEOUT" locked="false">120000</parameter>
            <parameter name="CONNECTION_TIMEOUT" locked="false">120000</parameter>
</transportSender>

repository/conf/synapse.properties

synapse.sal.endpoints.sesssion.timeout.default=600000
synapse.global_timeout_interval=600000

#In memory statistics cleaning state 
statistics.clean.enable=false

# Dependency tracking Synapse observer
# Comment out to disable dependency management
synapse.observers=org.wso2.carbon.mediation.dependency.mgt.DependencyTracker

# Uncomment following to support fallback XPATH 2.0 support with DOM and Saxon
#synapse.xpath.dom.failover.enabled=true
synapse.temp_data.chunk.size=3072

# A configuration to add tenant information to the out thread local carbon context
synapse.carbon.ext.tenant.info=org.wso2.carbon.mediation.initializer.handler.CarbonTenantInfoConfigurator

#external component registration for secure vault xpath function lookup
synapse.xpath.func.extensions=org.wso2.carbon.mediation.security.vault.xpath.SecureVaultLookupXPathFunctionProvider

repository/conf/passthru-http.properties

## Pass-through HTTP transport specific tuning parameters
worker_pool_size_core=400
worker_pool_size_max=500
worker_thread_keepalive_sec=600
#worker_pool_queue_length=-1
#io_threads_per_reactor=2
io_buffer_size=16384
#http.max.connection.per.host.port=32767
http.socket.timeout=600000

# This property is crucial for automated tests
http.socket.reuseaddr=true

## Other parameters
#http.user.agent.preserve=false
#http.server.preserve=true
#http.connection.disable.keepalive=false
rest.dispatcher.service=__MultitenantDispatcherService
# URI configurations that determine if it requires custom rest dispatcher
rest_uri_api_regex=\\w+://.+:\\d+/t/.*|\\w+://.+\\w+/t/.*|^(/t/).*
rest_uri_proxy_regex=\\w+://.+:\\d+/services/t/.*|\\w+://.+\\w+/services/t/.*|^(/services/t/).*

with no luck. Test backend URL: http://rzrbld.ru/timeout/index.php (70 sec Timeout hardcoded)

Was it helpful?

Solution

Since you are using the nhttp as a transport, add [1] and [2] in the nhttp.properties

[1] and [2] will help you to define the time out separately in the server and client side

[1]http.socket.timeout.receiver = Socket timeout for Listener [2]http.socket.timeout.sender = Socket timeout for Sender

Example [1] http.socket.timeout.receiver=120000 [2] http.socket.timeout.sender=120000

OTHER TIPS

Increasing http.socket.timeout in nhttp.properties will not help since ESB-4.8.X use passthru transport by default. Please add http.socket.timeout=600000 to ESB_HOME/repository/conf/passthru-http.properties file and restart server.

Thanks! Charitha

The Pass Through proxy uses an anonymous endpoint with default configuration, you should try to add and use a named endpoint on which you can configure the timeout.

An other solution would be to use Header "To" and send mediator. In that case, the timeout configured with http.socket.timout should be taken into account :

<header name="To" value="http://host:port/xxx"/>
<send/>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top