You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use dispatch (reboot) 0.9.3 to access a long-running HTTPS end point, however I consistent get a connection time out after 60s.
I am trying to set the timeout to 300s, and in tests with the same code against a non-SSL HTTP end point the code work as expected -- it holds until the response is returned.
Am I configuring async-http-client or dispatch improperly for HTTPS end points?
It seems that for an HTTPS end point dispatch is not connecting fully to the HTTPS service.
The code I use is:
val request = dispatch.url( endpt ).secure
val body = requestBodyFor( inquiry ).toString
request << body.toString
// actually I hold http in a variable that is lazy created but this is close enough
val response = http( request > as.String ).either
def http: dispatch.Http = {
val client = new AsyncHttpClient(
new AsyncHttpClientConfig.Builder()
.setAllowPoolingConnection( true )
.setAllowSslConnectionPool( true )
.setConnectionTimeoutInMs( outer.timeout.toInt )
.setIdleConnectionTimeoutInMs( outer.timeout.toInt )
.setMaxRequestRetry( 3 )
.setRequestTimeoutInMs( outer.timeout.toInt )
.setAsyncHttpClientProviderConfig(
new NettyAsyncHttpProviderConfig().addProperty(
NettyAsyncHttpProviderConfig.BOSS_EXECUTOR_SERVICE,
juc.Executors.newCachedThreadPool( DaemonThreads.factory )
)
).build()
)
dispatch.Http( client = client ).waiting( dispatch.Duration.millis( outer.timeout ) )
}
endpt is a configured string that is the URL I'm trying to hit; e.g., "https://www.foo.com/bar" timeout is also configured in ms -- currently set to 300000
even though I set the timeout to 300000ms (5mins), I get the following error after 1 minute:
[debug] c.n.h.c.p.n.NettyConnectListener - Trying to recover a dead cached channel [id: 0x06808e21] with a retry value of true
[debug] c.n.h.c.p.n.NettyConnectListener - Failed to recover from exception: java.net.ConnectException: Connection timed out with channel [id: 0x06808e21]
[debug] c.n.h.c.AsyncCompletionHandlerBase - Connection timed out to https://direct.backgroundchecks.com/integration/bgcdirectpost.aspx
java.net.ConnectException: Connection timed out to https://direct.backgroundchecks.com/integration/bgcdirectpost.aspx
at com.ning.http.client.providers.netty.NettyConnectListener.operationComplete(NettyConnectListener.java:100) ~[async-http-client.jar:na]
at org.jboss.netty.channel.DefaultChannelFuture.notifyListener(DefaultChannelFuture.java:428) [netty.jar:na]
at org.jboss.netty.channel.DefaultChannelFuture.notifyListeners(DefaultChannelFuture.java:419) [netty.jar:na]
at org.jboss.netty.channel.DefaultChannelFuture.setFailure(DefaultChannelFuture.java:381) [netty.jar:na]
at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.connect(NioClientSocketPipelineSink.java:409) [netty.jar:na]
at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.processSelectedKeys(NioClientSocketPipelineSink.java:366) [netty.jar:na]
Caused by: java.net.ConnectException: Connection timed out
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[na:1.7.0_07]
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:692) ~[na:1.7.0_07]
at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.connect(NioClientSocketPipelineSink.java:404) [netty.jar:na]
at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.processSelectedKeys(NioClientSocketPipelineSink.java:366) [netty.jar:na]
at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.run(NioClientSocketPipelineSink.java:282) [netty.jar:na]
at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:102) [netty.jar:na]
[debug] c.n.h.c.p.n.NettyAsyncHttpProvider - Channel Closed: [id: 0x06808e21] with attachment null
[debug] c.n.h.c.p.n.NettyAsyncHttpProvider - Unexpected I/O exception on channel [id: 0x06808e21]
java.net.ConnectException: Connection timed out
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[na:1.7.0_07]
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:692) ~[na:1.7.0_07]
at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.connect(NioClientSocketPipelineSink.java:404) ~[netty.jar:na]
at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.processSelectedKeys(NioClientSocketPipelineSink.java:366) ~[netty.jar:na]
at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.run(NioClientSocketPipelineSink.java:282) ~[netty.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [na:1.7.0_07]
[debug] c.n.h.c.p.n.NettyAsyncHttpProvider - Closing Channel [id: 0x06808e21]
Again, if I change only the endpoint to a non-SSL URL, the code works as expected and waits up till 5mins for the response.
Thanks in advance!
The text was updated successfully, but these errors were encountered:
I am trying to use dispatch (reboot) 0.9.3 to access a long-running HTTPS end point, however I consistent get a connection time out after 60s.
I am trying to set the timeout to 300s, and in tests with the same code against a non-SSL HTTP end point the code work as expected -- it holds until the response is returned.
Am I configuring async-http-client or dispatch improperly for HTTPS end points?
It seems that for an HTTPS end point dispatch is not connecting fully to the HTTPS service.
The code I use is:
endpt is a configured string that is the URL I'm trying to hit; e.g., "https://www.foo.com/bar" timeout is also configured in ms -- currently set to 300000
even though I set the timeout to 300000ms (5mins), I get the following error after 1 minute:
Again, if I change only the endpoint to a non-SSL URL, the code works as expected and waits up till 5mins for the response.
Thanks in advance!
The text was updated successfully, but these errors were encountered: