-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MRESOLVER-308] HTTP transport showdown. #231
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
56fbf3e
to
343f21b
Compare
Introduces 3 new transport: Jetty HttpClient 10.x, OkHttp 4.x and Java 11 HttpClient based ones. These are all HTTP/2 capable transports. Also, some reshuffle around HTTP tests, made them reusable to be able to use them in all HTTP based transports. --- https://issues.apache.org/jira/browse/MRESOLVER-308
343f21b
to
1113b62
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should bump the version to 1.10 due to the build requirement change.
Do we really want to keep maintaining that many resolver transport modules? If there is a clear winner performance wise, why not dropping the other modules? I fail to see the advantage of providing that many options... |
There can never be a clear winner since every client is different and every environment is different. We just need a small decent set. |
} | ||
} | ||
} | ||
httpClient.start(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there any call to stop()
to cleanup?
Shouldn't be a problem for mvn
as jvm is stopped but for mvnd
?
But my understanding of the code there is only one per repo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, stopping the client is missing, as noted in "Important notes" (3rd bullet). Client is created per-session, per-remote repository.
Exactly, for me shipping 5 HTTP transport modules is too much. That also makes the decision for consumers much harder. |
Just to clear up: the fact we have here 5 (7 to be exact) transports, that does not mean we need to deliver all these with Maven. Or in other words, transport-http, transport-file and transport-classpath was present since day 0 (of resolver existence), but no Maven included it so far. Maven 3.9/4.0 will be the first that will include transport-http. There are 4 transports already (file, http, wagon, classpath), and this PR adds 3 new modules. But, the thing is, these are all for HTTP protocol (when protocol of remote repository is HTTP/HTTPS). These are the "old" ones:
While these are new:
New ones are all HTTP/2 capable. Personally, from new ones, I'd remove okhttp (cons: pulls in kotlin runtime and is slowest H2 client). Java11 and Jetty were really close to each other. In short: the fact a transport is present here, does not mean we must ship it, as the case of transport-classpath and transport-http shows (they were present since day 0 of resolver, but never shipped). |
Whether we ship with Maven or not is completely orthogonal to me. If they are part of resolver releases we should make sure they work properly and I don't see the capacity to maintain that many modules (nor the need TBH) |
My 2cts would be that That said, fact it does not work with |
It does not work currently, but #232 is here to solve that bit as well (naturally, once that is merged, this PR will need changes: to hook into those). also see apache/maven#941 |
I agree, but let's make it in different change (as we have currently 2 PRs overlapping somewhat, this and onSessionClose). So let's make the 1.10.0 bump change in separate commit (and update JIRA) |
As nobody objected, I will drop okhttp transport, so lowering this PR to addition of 2 transports (java11 and Jetty). |
Removed this PR from 2.0.0 milestone, but am keeping it, as while main code is already on master, there may be some test related bits we will need. |
We are past this, so no reason to keep it anymore, closing it. |
Introduces
32 new transport: Jetty HttpClient 10.x,OkHttp 4.xand Java 11 HttpClient based ones. These are all HTTP/2 capable transports. 2 out of 3 new ones requires Java 11, hence corresponding modules lavel raised to Java11 and Java 11 is required to build (sniffer removed, using compiler release flag) but the library still remains Java 8!Also, some reshuffle around HTTP tests, made them reusable to be able to use them in all HTTP based transports.
High level changes:
Important notes
For perf tests (kinda) look at related JIRA issue https://issues.apache.org/jira/browse/MRESOLVER-308
New Transports
This PR introduces 3 new transports for resolver:
Java 11 HttpClient transport
Uses Java 11 HttpClient to implement transport, it prefers HTTP/2 and supports HTTP/1.1.
The build produces one 27KB JAR, that can be placed into Maven
lib/ext
of any Maven version that uses Resolver 1.9.2+. The transport remains dormant when Maven runs on Java 8, while activates (and becomes default) when Java 11+ used to run Maven.Jetty 10.x Client transport
Uses Jetty 10.x Client to implement transport. When remote repository is HTTPS, it prefers HTTP/2 and supports HTTP/1.1, otherwise speaks HTTP/1.1 only.
The build produces "pgk.zip" classified artifact with transport and all of it's needed dependencies. To use it, unpack the ZIP into Maven
lib/ext
of any Maven version that uses Resolver 1.9.2+ and use Java 11 or above to run Maven.OkHttp 4.10.x transportUses OkHttp 4.10.x to implement transport. Supports HTTP/2 and HTTP/1.1.The build produces "pgk.zip" classified artifact with transport and all of it's needed dependencies. To use it, unpack the ZIP into Mavenlib/ext
of any Maven version that uses Resolver 1.9.2+.OkHttp transport is about to be dropped.
Note:
https://issues.apache.org/jira/browse/MRESOLVER-308