@LoadBalanced RestClient#1294
Conversation
… RestClient class present.
…igs. Add more tests.
|
Hi @Buzzardo, could you please review documentation changes? |
Buzzardo
left a comment
There was a problem hiding this comment.
Good changes. Sorry about the code font not rendering in headings. Your instinct to put it in is correct, but it doesn't work well across our various outputs.
|
|
||
| [[rest-template-loadbalancer-client]] | ||
| == Spring RestTemplate as a Load Balancer Client | ||
| == Spring `RestTemplate` as a LoadBalancer Client |
There was a problem hiding this comment.
Remove the ticks around RestTemplate. Your instinct is right, but we have had trouble with rendering code fonts in headings, so we had to remove it.
| Add xref:spring-cloud-commons/loadbalancer.adoc#spring-cloud-loadbalancer-starter[Spring Cloud LoadBalancer starter] to your project in order to use it. | ||
|
|
||
| [[multiple-resttemplate-objects]] | ||
| === Multiple `RestTemplate` Objects |
There was a problem hiding this comment.
Remove the ticks around RestTemplate. As I mentioned in the previous comment, we have trouble with rendering the code font in headings.
| TIP: If you see errors such as `java.lang.IllegalArgumentException: Can not set org.springframework.web.client.RestTemplate field com.my.app.Foo.restTemplate to com.sun.proxy.$Proxy89`, try injecting `RestOperations` or setting `spring.aop.proxyTargetClass=true`. | ||
|
|
||
| [[rest-client-loadbalancer-client]] | ||
| == Spring `RestClient` as a LoadBalancer Client |
There was a problem hiding this comment.
Remove the ticks around RestClient. It won't render correctly.
| The `BlockingLoadBalancerClient` is used to create a full physical address. | ||
|
|
||
| IMPORTANT: To use a load-balanced `RestClient`, you need to have a Spring LoadBalancer implementation in your classpath. | ||
| Add xref:spring-cloud-commons/loadbalancer.adoc#spring-cloud-loadbalancer-starter[Spring Cloud LoadBalancer starter] to your project in order to use it. |
There was a problem hiding this comment.
Change to:
To use it, add xref:spring-cloud-commons/loadbalancer.adoc#spring-cloud-loadbalancer-starter[Spring Cloud LoadBalancer starter] to your project.
|
|
||
| [[webclinet-loadbalancer-client]] | ||
| == Spring WebClient as a Load Balancer Client | ||
| == Spring `WebClient` as a LoadBalancer Client |
There was a problem hiding this comment.
Remove the ticks around WebClient. The code font does not render correctly in headings.
| Then, `ReactiveLoadBalancer` is used underneath. | ||
|
|
||
| [[multiple-webclient-objects]] | ||
| === Multiple `WebClient.Builder` Objects |
There was a problem hiding this comment.
Remove the ticks around WebClient.Builder. The code font does not render correctly in headings.
| == Spring Cloud LoadBalancer integrations | ||
|
|
||
| In order to make it easy to use Spring Cloud LoadBalancer, we provide `ReactorLoadBalancerExchangeFilterFunction` that can be used with `WebClient` and `BlockingLoadBalancerClient` that works with `RestTemplate`. | ||
| In order to make it easy to use Spring Cloud LoadBalancer, we provide `ReactorLoadBalancerExchangeFilterFunction` that can be used with `WebClient` and `BlockingLoadBalancerClient` that works with `RestTemplate` and `RestClient`. |
There was a problem hiding this comment.
Change to:
To make it easy to use Spring Cloud LoadBalancer, we provide ReactorLoadBalancerExchangeFilterFunction (which can be used with WebClient) and BlockingLoadBalancerClient (which works with RestTemplate and RestClient).
The parentheses break up a long sentence and make it more clear. "In order to" can nearly always be changed to "To". Edit to add: That's not your fault. That sentence had problems in the first place. While we have the chance, though, we may as well improve it.
|
|
||
| TIP: For the non-reactive stack, create this supplier with the `withBlockingHealthChecks()`. | ||
| You can also pass your own `WebClient` or `RestTemplate` instance to be used for the checks. | ||
| You can also pass your own `WebClient`, `RestTemplate` or `RestClient` instance to be used for the checks. |
There was a problem hiding this comment.
Add a comma after `RestTemplate. The Spring Style Guide calls for serial commas (a comma before the last item in a list).
|
Thanks, @Buzzardo 🙂 |
This reverts commit dd47ca6.
|
Issues in docs fixed within a1c355e. |
Fixes gh-1293.