-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from wcm-io-caravan/feature/Provide-customizab…
…le-WebClient Provide the ability to customize the WebClient instance used in the HalResourceLoader
- Loading branch information
Showing
5 changed files
with
104 additions
and
36 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
integration/spring/src/main/java/io/wcm/caravan/rhyme/spring/api/HttpClientCustomizer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package io.wcm.caravan.rhyme.spring.api; | ||
|
||
import reactor.netty.http.client.HttpClient; | ||
|
||
/** | ||
* Callback interface that can be used to customize a {@link reactor.netty.http.client.HttpClient}. E.g., to add a proxy configuration. | ||
*/ | ||
@FunctionalInterface | ||
public interface HttpClientCustomizer { | ||
|
||
/** | ||
* Callback to customize a {@link reactor.netty.http.client.HttpClient} instance. | ||
* @param httpClient the client to customize | ||
*/ | ||
void customize(HttpClient httpClient); | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
integration/spring/src/main/java/io/wcm/caravan/rhyme/spring/api/WebClientProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package io.wcm.caravan.rhyme.spring.api; | ||
|
||
import java.net.URI; | ||
|
||
import org.springframework.web.reactive.function.client.WebClient; | ||
|
||
/** | ||
* Callback interface to provide an instance of {@link WebClient} for the given uri. | ||
*/ | ||
@FunctionalInterface | ||
public interface WebClientProvider { | ||
|
||
/** | ||
* Returns an instance of {@link WebClient} for the given uri. | ||
*/ | ||
WebClient webClientForUri(URI uri); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters