Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 343567

Summary: HttpClient does not limit the destination's exchange queue
Product: [RT] Jetty Reporter: Simone Bordet <simone.bordet>
Component: clientAssignee: Simone Bordet <simone.bordet>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jetty-inbox
Version: 7.4.0   
Target Milestone: 7.2.x   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Simone Bordet CLA 2011-04-21 11:19:23 EDT
A client may perform requests to the same address at a rate faster than what the server can respond.
In this case, HttpDestination queues the requests in a unbounded queue, so the client has no idea that it is producing requests at a too fast rate.
Increasing the number of connections may be a solution, but often this parameter is limited to save resources.

We need a mechanism where we can limit the HttpDestination queue and reject the new requests that overflows the queue, so the client can handle the situation and eventually slow down the request rate.
Comment 1 Simone Bordet CLA 2011-04-21 11:30:46 EDT
Added method HttpClient.setMaxQueueSizePerAddress(int), and HttpDestination.setMaxQueueSize(int), and throwing RejectedExecutionException in case the queue limit is reached.