Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-dev] Clarification on synchronous and asynchronous request model for Jetty

Thanks Simone. This means that we should upgrade to Jetty v 9.4.x in order to leverage many efficient features.

Additionally, another thing that I would like to clarify with 9.3.x is regarding proxy usage.
We create a high level HTTPClient that uses the HttpClientTransportOverHTTP2 and makes use of the lower level Http2Client to execute HTTP/2 requests.
Now, we set the proxy configuration on the high level HTTP Client object.

1. Is it OK to set a HTTP/1 forward proxy server to act as a tunnel for HTTP/2 requests?
2. Also it seems that we cannot tunnel HTTPS requests using HTTP/1 proxy server to HTTP/2 server. 
3. In my unit tests, I set up a simple HTTP/1 server as proxy server and a HTTP/2 server as the target end point. Any requests sent directly to my local HTTP/2 server complete successfully. However, when I try to tunnel the same requests using the local proxy server, I end up getting the following exception:

Caused by: java.nio.channels.ClosedChannelException
at org.eclipse.jetty.http2.HTTP2Session.onShutdown(HTTP2Session.java:818)
at org.eclipse.jetty.http2.HTTP2Connection$HTTP2Producer.produce(HTTP2Connection.java:191)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:162)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.execute(ExecuteProduceConsume.java:101)
at org.eclipse.jetty.http2.HTTP2Connection.onOpen(HTTP2Connection.java:81)
at org.eclipse.jetty.http2.client.HTTP2ClientConnectionFactory$HTTP2ClientConnection.onOpen(HTTP2ClientConnectionFactory.java:148)
at org.eclipse.jetty.io.SelectorManager.connectionOpened(SelectorManager.java:307)
at org.eclipse.jetty.io.ManagedSelector.createEndPoint(ManagedSelector.java:414)
at org.eclipse.jetty.io.ManagedSelector.access$1600(ManagedSelector.java:56)
at org.eclipse.jetty.io.ManagedSelector$CreateEndPoint.run(ManagedSelector.java:587)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.execute(ExecuteProduceConsume.java:101)
at org.eclipse.jetty.io.ManagedSelector.run(ManagedSelector.java:136)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
at java.lang.Thread.run(Thread.java:745)

Not sure if I am missing something here, but any hints/inputs would help me in going further.

Thanks
Neha

On Mon, May 15, 2017 at 1:26 AM, Simone Bordet <sbordet@xxxxxxxxxxx> wrote:
Hi,

On Fri, May 12, 2017 at 7:51 PM, Neha Munjal <neha.munjal3@xxxxxxxxx> wrote:
> Thanks Simone. That clarifies my query.
> Additionally, we have a requirement to do HTTP/2 communication with the
> target end point.
> We are creating a high level Jetty HttpClient that makes use of
> HttpClientTransportOverHTTP2 transport mechanism as follows:
>
> httpClient = new HttpClient(new HttpClientTransportOverHTTP2(http2Client),
>                     sslContextFactory);
>
> We are setting the following 2 properties on the httpClient object:
>
> MaxConnectionsPerDestination : 50
> MaxRequestsQueuedPerDestination: 5000
>
> Would like to clarify that if we use the the above mechanism, would we
> actually maintain a pool of 50 connections and leverage the underlying
> connection pool mechanism.

That is correct with Jetty 9.4.x. Earlier versions did not have a
connection pool for HTTP/2.

> Do we have any logs that we can enable to see that in case of high load of
> requests, we are fully leveraging the connection pool.

There are few that you may be interested in.
Enable DEBUG logging for "org.eclipse.jetty.client", and then retain
only those you need.

--
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.
_______________________________________________
jetty-dev mailing list
jetty-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-dev


Back to the top