Skip to content

Commit 4c2c257

Browse files
authored
Fix documentation for client-thrift and client-retry (#6195)
Motivation: I found an incorrect class name and the use of deprecated functions in the document. Therefore I fixed it to use the recommended function instead. Modifications: - Change `ThriftClient` to `ThriftClients` - Use `RetryConfig` instead of deprecated functions. Result: - The corrected document will be displayed.
1 parent 3811f4e commit 4c2c257

2 files changed

Lines changed: 13 additions & 7 deletions

File tree

site/src/pages/docs/client-retry.mdx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,10 @@ the maximum number of total attempts to 10 by default. You can change this value
221221
`maxTotalAttempts` when you build a <type://RetryingClient>:
222222

223223
```java
224-
RetryingClient.newDecorator(rule, maxTotalAttempts);
224+
RetryConfig config = RetryConfig.builder(rule)
225+
.maxTotalAttempts(maxTotalAttempts)
226+
.build();
227+
RetryingClient.newDecorator(config);
225228
```
226229

227230
Or, you can override the default value of 10 using the JVM system property
@@ -246,8 +249,11 @@ Second, it occurs when the time of individual attempt in retry has passed the ti
246249
You can configure it when you create the decorator:
247250

248251
```java
249-
RetryingClient.newDecorator(rule, maxTotalAttempts,
250-
responseTimeoutMillisForEachAttempt);
252+
RetryConfig config = RetryConfig.builder(rule)
253+
.maxTotalAttempts(maxTotalAttempts)
254+
.responseTimeoutMillisForEachAttempt(responseTimeoutMillisForEachAttempt)
255+
.build();
256+
RetryingClient.newDecorator(config);
251257
```
252258

253259
You can retry on this <type://ResponseTimeoutException>.

site/src/pages/docs/client-thrift.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ using <type://ThriftClientBuilder#serializationFormat(SerializationFormat)>.
4141
import com.linecorp.armeria.common.thrift.ThriftSerializationFormats;
4242

4343
HelloService.Iface helloService =
44-
ThriftClient.builder("http://127.0.0.1:8080")
45-
.path("/hello")
46-
.serializationFormat(ThriftSerializationFormats.JSON)
47-
.build(HelloService.Iface.class); // or AsyncIface.class
44+
ThriftClients.builder("http://127.0.0.1:8080")
45+
.path("/hello")
46+
.serializationFormat(ThriftSerializationFormats.JSON)
47+
.build(HelloService.Iface.class); // or AsyncIface.class
4848
```
4949

5050
Since we specified `HelloService.Iface` as the client type, `ThriftClients.newClient()` will return a

0 commit comments

Comments
 (0)