Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Preventing queuing of requests when all connections exhausted

Hi,

On Thu, Dec 11, 2014 at 11:19 PM, John Gardiner Myers
<jgmyers@xxxxxxxxxxxxxx> wrote:
> I want to configure Jetty client so that if all MaxConnectionsPerDestination
> are in use then additional requests to that destination immediately fail
> rather than queue. If a destination is hung, better to immediately fail over
> to another instance of the service than sit in the request queue for some
> multiple of the idle timeout.
>
> Unfortunately, setting MaxRequestsQueuedPerDestination to zero prevents
> initiating any requests whatsoever. Setting it to the same value as
> MaxConnectionsPerDestination allows that many requests to be initiated, but
> once those requests are assigned to and consume connections a second batch
> of that many requests can be initiated and will queue waiting for the first
> batch to complete.
>
> Any suggestions? If this required a new feature, what would the feature look
> like?

This would require a refactoring of the code to reject the offer() to
the queue in case you have all connections active.
Can you please file an issue about this ?

If it is possible to generalize this feature also to a multiplexed
connection, I think it would be a boolean in HttpClient.
Otherwise you will have a method to override to return true/false
based on your conditions.

-- 
Simone Bordet
----
http://cometd.org
http://webtide.com
http://intalio.com
Developer advice, training, services and support
from the Jetty & CometD experts.
Intalio, the modern way to build business applications.


Back to the top