Hi,

Is there any reason that org.apache.http.impl.client.HttpClients (from 
org.apache.httpcomponents) can’t be used instead?

It looks like it handles connection pooling as well as well as allowing 
asynchronous requests. It looks as though MultithreadedHttpClient was written 
before this became available so it would make sense to swap it out to reduce 
the maintenance burden in GeoTools.

I was looking at it to enable client side SSL authentication on HTTP 
connections when cascading from WMTS i.e. where the source WMTS server wants 
you to authenticate using a certificate

Kind regards

Dan

From: Roar Brænden <roar.brenden...@gmail.com>
Sent: 09 November 2020 11:31
To: geotools-devel@lists.sourceforge.net
Cc: Watermeyer, Andreas <andreas.waterme...@its-digital.de>
Subject: Re: [Geotools-devel] [GEOT-6727] WFS MultithreadedHttpClient must not 
ignore nonProxyHosts

Hi,

I've had some troubles figuring out the usage of http clients within GeoTools. 
Lastly it was when I looked at gt-tile-client / gt-wmts. My main issue then was 
to make asynchronous requests. It doesn't seem like the implementations of 
MultithreadedHttpClient solves such issues. They are most concerned about 
connection reuse, which is important as well.

The foundation for a plugin is laying there with some interfaces in gt-main, 
but there are no factories. All implementations seems to be using new 
SimpleHttpClient(). A possible reason for this could be that the interfaces are 
hidden in the namespace org.geotools.data.ows. I think it would have been 
better to place them in a namespace org.geotools.http, and maybe outside of 
gt-main in gt-http?

I've search for the usage of HttpClient within Geotools / Geoserver, and found 
these occurrences:

 - gs-main
Used in conjunction with tests. Also some ad hoc code that suggests HttpClient 
should inherit Closable or AutoClosable.

 - gs-web-core
Used in conjunction with validating cascading WMS / WFS.

 - gs-wms
Used in a single function getCascadedJSONRules. Suggests that response by JSON 
should be an option.

 - gt-main
Five implementations: DelegatingHttpClient, AbstractHttpClient, 
LoggingHttpClient, MockHttpClient and SimpleHttpClient.

 - gt-mbstyle
Using SimpleHttpClient to retrieve JSON and pictures. The pictures are fetched 
as an InputStream and then converted into a BufferedImage by using ImageIOExt.

 - gt-mongodb
Used to download schema file using InputStream. Clients are fed in with the 
constructor, making it possible to specify username / password.

 - gt-tile-client
Used in constructor.

 - gt-wfs-ng
Implementation of a MultithreadedHttpClient, and a configuration to let the 
user specify if he want to use Connection Pooling or not. That should be taken 
into account by a factory as well. Otherwise there are usual code to set up the 
client as username / password.

 - gt-wms
New implementation of MultithreadedHttpClient. Only usage seems to be from 
gs-wms.

 - gt-wmts
Clients are fed into the object by constructors, and used to retrieve images by 
ImageIOExt read from InputStream. Definitely having a sequential approach.

 - gt-wps
Clients are fed into the objects by constructors.


Something should certainly be done, but what would be the best approach to move 
this forward?

Best regards,

Roar Brænden




29. okt. 2020 kl. 14:29 skrev Andrea Aime 
<andrea.a...@geo-solutions.it<mailto:andrea.a...@geo-solutions.it>>:

Hi Andreas,
this is just my personal opinion, others might want to chime in.
Since MultithreadedHttpClient depends on Commons HTTPclient
I would suggest avoiding gt-main.

I see we're still depending on commons-httpclient 3.1 there,
which is not awfully large, 300k give or take, and two more depds of it,
commons logging and commons-codec, which push the total to 400k,
none of them being currently a gt-main dependency.

Instead, I would suggest to make it into its own plugin module, probably
under plugin or extensions (suggestions?), that provides this functionality, 
and both
gt-wms and gt-wfs can depend on it, in turn.

Cheers
Andrea


On Thu, Oct 29, 2020 at 12:54 PM Watermeyer, Andreas 
<andreas.waterme...@its-digital.de<mailto:andreas.waterme...@its-digital.de>> 
wrote:
Hi all,

I recently raised an issue because the GT WFS HTTPClient respects the proxy 
settings only partially. It ignores the “nonProxyHosts” settings:
https://osgeo-org.atlassian.net/browse/GEOT-6727

I then realized, that the class MultithreadedHttpClient exists in the WMS and 
in the WFS module, as copies. WMS was already extended to support nonProxyHosts 
and also Gzip compression.
Ideally both will be merged into one again.

Q: Which module could take the common implementation? Maybe gt-main? I think it 
is the only dependency the  WMS and WFS module have in common.
Or do you prefer to keep the separat copies of the class to have keep the 
modules less coupled?

I can offer a pull request but I need a direction to go…

Best regards,
Andreas
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net<mailto:GeoTools-Devel@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/geotools-devel


--
Regards, Andrea Aime
== GeoServer Professional Services from the experts! Visit http://goo.gl/it488V 
for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions 
S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: 
+39 0584 1660272 mob: +39 339 8844549 
http://www.geo-solutions.it<http://www.geo-solutions.it/> 
http://twitter.com/geosolutions_it 
------------------------------------------------------- Con riferimento alla 
normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento 
generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza 
inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è 
un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo 
scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, 
ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene 
notizia. This email is intended only for the person or entity to which it is 
addressed and may contain information that is privileged, confidential or 
otherwise protected from disclosure. We remind that - as provided by European 
Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or 
the information herein by anyone other than the intended recipient is 
prohibited. If you have received this email by mistake, please notify us 
immediately by telephone or e-mail.
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net<mailto:GeoTools-Devel@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/geotools-devel

_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to