Connection timeout in ServerConfig

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Connection timeout in ServerConfig

Five_Sigma
Hi there,

I'm developing a micro service server in which requests can go through n services. I'm trying to set a global connection timeout for the whole server, but I think I'm misunderstanding how the connection timeout works in ServerConfig.

For example, suppose we have a service working as REST API and one more connecting with a database, both of them are built using Java and Ratpack. I choose connectionTimeoutMillis in 100 in the API, send a request which gets something from the database and it works even when the elapsed time was more than 100 ms. Of course, when the API connects the other service it uses a Blocking.get statement.

Could it be that request time pauses when the request is sent to the other service using Blocking.get? I cannot think anything else

How should I proceed to set this connection timeout for my whole server?

Thanks guys
Reply | Threaded
Open this post in threaded view
|

Re: Connection timeout in ServerConfig

Luke Daley
Administrator
That connect timeout is not what you are thinking it is. It is effectively how long the server will wait for data from the client when establishing a connection before giving up.

There's no global operation timeout in Ratpack. You'll need to think about different strategies for different systems you use.