-
Notifications
You must be signed in to change notification settings - Fork 585
4.x: Web Client Discovery integration #10786
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
base: main
Are you sure you want to change the base?
Conversation
tjquinno
left a comment
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.
A couple possible small changes.
webclient/discovery/src/main/java/io/helidon/webclient/discovery/DefaultWebClientDiscovery.java
Outdated
Show resolved
Hide resolved
tomas-langer
left a comment
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.
The way the webclient discovery is configured seems very complicated to me. I think this deserves more attention. I think we should dedicate some time for it on our weekly meeting
webclient/discovery/src/main/java/io/helidon/webclient/discovery/DefaultWebClientDiscovery.java
Outdated
Show resolved
Hide resolved
...lient/discovery/src/main/java/io/helidon/webclient/discovery/WebClientDiscoveryProvider.java
Show resolved
Hide resolved
webclient/discovery/src/test/java/io/helidon/webclient/discovery/TestURI.java
Outdated
Show resolved
Hide resolved
webclient/discovery/src/test/java/io/helidon/webclient/discovery/URITest.java
Outdated
Show resolved
Hide resolved
webclient/discovery/src/test/java/io/helidon/webclient/discovery/UriEncodingTest.java
Outdated
Show resolved
Hide resolved
webclient/discovery/src/test/java/io/helidon/webclient/discovery/WebClientTest.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Laird Nelson <[email protected]>
…E.md Signed-off-by: Laird Nelson <[email protected]>
…ests that exposed it Signed-off-by: Laird Nelson <[email protected]>
Signed-off-by: Laird Nelson <[email protected]>
Signed-off-by: Laird Nelson <[email protected]>
Signed-off-by: Laird Nelson <[email protected]>
3cb5be0 to
94c1613
Compare
Web Client Discovery
Summary
This PR integrates Discovery with Helidon Web Client by introducing a suitable
WebClientServiceimplementation (as required for such integrations).Pull Request
The heart of the pull request is the
WebClientDiscoveryinterface (an extension of theWebClientServiceinterface) and theDefaultWebClientDiscoveryclass that implements it. All other.javafiles are boilerplate or scaffolding related to the required usage of Helidon Builder.The full specification of this integration can be found in the documentation of the
WebClientDiscovery#handle(io.helidon.webclient.spi.WebClientService.Chain, io.helidon.webclient.api.WebClientServiceRequest)method.Documentation
Documentation included in this pull request consists of:
webclient.adocdiscovery.adocThanks in particular to @tjquinno, @romain-grecourt and @barchetta for their collective design and documentation help.
Requirements
Discovery is opt-in, not out-out, so Web Client Discovery must be opt-in as well.
Discovery itself can be disabled, and
WebClientServiceProviderimplementations can be disabled. When either is disabled, the implementation must continue by using any supplied URIs "as is".Discovery must not prevent requests from completing, even in the face of errors, so Web Client Discovery must not either.
It must be easy to see (in configuration, etc.) which Web Client requests are subject to discovery, and which are not.
Given a
WebClientServiceRequest, the implementation must be able to retrieve or infer a discovery name and a default URI from its contents.Given a
UriInfo, the implementation must have a deterministic algorithm for combining path information that is part of the discovered URI returned by discovery, path information that is part of the default URI submitted as part of discovery, and remaining path information that is part of theUriInfothat is not part of either.Invariants and Constraints
Invariant: The implementation fundamentally must be a
WebClientServicecreated by aWebClientServiceProviderimplementation and therefore must adhere to its requirements as described in its javadocs.Invariant: Helidon Builder API must be used.
Invariant: Textual representations of URIs must not be used as configuration keys.
Invariant: Properties must not be used as the primary means of configuration.
Constraint:
ClientRequestBasesupports only URIs whose schemes arehttporhttps. (See also issue 10752.)Constraint:
ClientUridoes not support opaque URIs.Constraint:
ClientUripaths are never empty, even when explicitly set to be empty.Constraint:
ClientUri#create()returns aClientUriwith aschemecomponent ofhttp, ahostcomponent oflocalhost, aportcomponent of80and apathof/.Sample Javadoc
io.helidon.webclient.discovery.WebClientDiscoveryJavadoc HTML pages are not capturable by full-screen screenshot tools. Screenshots are accordingly paged below.
Page 1
Page 2
Page 3
Page 4