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
Issue #1350 - Dynamic selection of the transport to use based on ALPN on the client side. #3313
Issue #1350 - Dynamic selection of the transport to use based on ALPN on the client side. #3313
Conversation
@gregw with respect to what we discussed, here is what I ended up doing. WRT having one destination with multiple connection pools, that is a larger change that impacts for example WRT setting the |
a2ffd6f
to
e2e7f99
Compare
This PR needs an update/merge . |
e2e7f99
to
cab0f2d
Compare
@sbordet Do we need to get this resolved before a 10.0 release? |
@gregw yes |
… on the client side. Introduced `HttpClientTransportDynamic` to be able to switch transport dynamically. Refactored other transports and HttpDestination, removing now unnecessary classes. Introduced ProxyProtocolClientConnectionFactory and used it for testing. Updated OSGi tests now that jetty-client depends on jetty-alpn-client. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
cab0f2d
to
aa211b0
Compare
@@ -1109,7 +1140,7 @@ protected HttpField getAcceptEncodingField() | |||
|
|||
protected String normalizeHost(String host) | |||
{ | |||
if (host != null && host.matches("\\[.*\\]")) | |||
if (host != null && host.matches("\\[.*]")) |
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.
Strange edit. Is this supposed to strip out the host from an IPv6 address/host?
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.
Apparently, in regexp you have to escape the opening [
, but not the closing ]
. That snippet tests whether the host name is written using the URI IPv6 notation.
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.
It's a big change, but I like it! 👍
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.
It's rather different than the last time I looked, so I think you need to walk me through it, although I'm seeing things that look good.
void setMaxRequestsPerConnection(int maxRequestsPerConnection); | ||
} | ||
|
||
public static class Info |
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.
I like the class.... but not sure Info
is the right name. Target
??
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.
I chose Key
- it's the key we use to hold destinations in a Map
.
jetty-client/src/main/java/org/eclipse/jetty/client/DuplexHttpDestination.java
Show resolved
Hide resolved
jetty-io/src/main/java/org/eclipse/jetty/io/ClientConnectionFactory.java
Show resolved
Hide resolved
… on the client side. Added javadocs and small changes after review. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
… on the client side. Simplified ProxyProtocolClientConnectionFactory to use Origin.Address rather than InetSocketAddress. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
jetty-client/src/main/java/org/eclipse/jetty/client/HttpClientTransport.java
Show resolved
Hide resolved
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.
Latest changes look good and naming is better.
Can't say I've completely understood the whole code, but I think it is definitely worth merging so we can work towards an alpha release.
Issue #1350.
Introduced
HttpClientTransportDynamic
to be able to switch transport dynamically.Refactored other transports and HttpDestination, removing now unnecessary classes.
Introduced ProxyProtocolClientConnectionFactory and used it for testing.
Updated OSGi tests now that jetty-client depends on jetty-alpn-client.
Signed-off-by: Simone Bordet simone.bordet@gmail.com