Mule - Connect timeout
<p>I have a problem with setting Connection Timeout on HTTP Request Connector (not to confuse with Response Timeout) with Mule 3.7. 
Configuration I'm using is not changing this arbitrary ~5 second delay between initiating connection and throwing "java.net.ConnectException: Connect timeout", even if <a href="https://docs.mulesoft.com/mule-user-guide/v/3.7/tcp-transport-reference" rel="nofollow">https://docs.mulesoft.com/mule-user-guide/v/3.7/tcp-transport-reference</a> suggests that setting connectionTimeout attribute should do the trick.</p>

<p>What am I missing? Is there any other way to specify this timeout? Or is this dependent on the OS?</p>

<p>Flow ilustrating the problem:
    </p>

<pre><code>&lt;mule xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:tcp="http://www.mulesoft.org/schema/mule/tcp" xmlns:tls="http://www.mulesoft.org/schema/mule/tls" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:quartz="http://www.mulesoft.org/schema/mule/quartz" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
    xmlns:spring="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/quartz http://www.mulesoft.org/schema/mule/quartz/current/mule-quartz.xsd
http://www.mulesoft.org/schema/mule/tls http://www.mulesoft.org/schema/mule/tls/current/mule-tls.xsd
http://www.mulesoft.org/schema/mule/tcp http://www.mulesoft.org/schema/mule/tcp/current/mule-tcp.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd"&gt;
    &lt;http:request-config name="HTTP_Request_Configuration"  host="123.123.123.123" port="4444"  doc:name="HTTP Request Configuration" responseTimeout="30000" usePersistentConnections="false" &gt;
        &lt;tcp:client-socket-properties connectionTimeout="30000" timeout="30000"/&gt;
    &lt;/http:request-config&gt;
    &lt;flow name="connectionTimeoutTestFlow"&gt;
        &lt;quartz:inbound-endpoint jobName="Knock" repeatInterval="60000" responseTimeout="100000" doc:name="Quartz"&gt;
            &lt;quartz:event-generator-job/&gt;
        &lt;/quartz:inbound-endpoint&gt;
        &lt;logger message="Start Request" level="INFO" doc:name="Logger"/&gt;
        &lt;http:request config-ref="HTTP_Request_Configuration" path="/debug/index.jsp" method="GET" doc:name="HTTP"/&gt;
    &lt;/flow&gt;
&lt;/mule&gt;
</code></pre>

<p>Output:</p>

<pre><code>INFO  2016-02-10 12:53:55,736 [[connectionTimeoutTest].connectionTimeoutTestFlow.stage1.02] org.mule.api.processor.LoggerMessageProcessor: Start Request
ERROR 2016-02-10 12:54:01,321 [[connectionTimeoutTest].connectionTimeoutTestFlow.stage1.02] org.mule.exception.DefaultMessagingExceptionStrategy: 
********************************************************************************
Message               : Error sending HTTP request. Message payload is of type: NullPayload
Type                  : org.mule.api.MessagingException
Code                  : MULE_ERROR--2
Payload               : {NullPayload}
JavaDoc               : http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html
********************************************************************************
Exception stack is:
1. Connect timeout (java.net.ConnectException)
  org.glassfish.grizzly.connectionpool.SingleEndpointPool$ConnectCompletionHandler:1283 (null)
2. java.net.ConnectException: Connect timeout (java.util.concurrent.ExecutionException)
  org.glassfish.grizzly.impl.SafeFutureImpl$Sync:349 (null)
3. java.util.concurrent.ExecutionException: java.net.ConnectException: Connect timeout (java.io.IOException)
  org.mule.module.http.internal.request.grizzly.GrizzlyHttpClient:234 (null)
4. Error sending HTTP request. Message payload is of type: NullPayload (org.mule.api.MessagingException)
  org.mule.module.http.internal.request.DefaultHttpRequester:287 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)
********************************************************************************
Root Exception stack trace:
java.net.ConnectException: Connect timeout
    at org.glassfish.grizzly.connectionpool.SingleEndpointPool$ConnectCompletionHandler.cancelled(SingleEndpointPool.java:1283)
    at org.glassfish.grizzly.impl.SafeFutureImpl.notifyCompletionHandlers(SafeFutureImpl.java:185)
    at org.glassfish.grizzly.impl.SafeFutureImpl.done(SafeFutureImpl.java:277)
    at org.glassfish.grizzly.impl.SafeFutureImpl$Sync.innerCancel(SafeFutureImpl.java:389)
    at org.glassfish.grizzly.impl.SafeFutureImpl.cancel(SafeFutureImpl.java:247)
    at org.glassfish.grizzly.connectionpool.SingleEndpointPool$ConnectTimeoutWorker.doWork(SingleEndpointPool.java:1351)
    at org.glassfish.grizzly.connectionpool.SingleEndpointPool$ConnectTimeoutWorker.doWork(SingleEndpointPool.java:1343)
    at org.glassfish.grizzly.utils.DelayedExecutor$DelayedRunnable.run(DelayedExecutor.java:158)
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:591)
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571)
    at java.lang.Thread.run(Thread.java:744)

********************************************************************************
</code></pre>