Skip to content

Commit

Permalink
doc: add description for LogProxy client parameters. (#79)
Browse files Browse the repository at this point in the history
* Enhancement:add doc for ClientConf of LogProxy

* Enhancement:fix doc.
  • Loading branch information
yuanoOo authored Sep 13, 2024
1 parent 072efeb commit f3ef7fb
Show file tree
Hide file tree
Showing 2 changed files with 216 additions and 2 deletions.
109 changes: 108 additions & 1 deletion docs/quickstart/logproxy-client-tutorial-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,114 @@ client.join();

调用函数 `LogProxyClient.start()` 会启动一个新的线程,该线程将使用 Netty 建立一个到 LogProxy 的连接,并通过该连接接收日志数据。

LogProxy 客户端还可以通过 `ClientConf` 配置一些客户端行为相关的参数,如下所示是一个使用自定义 `ClientConf` 的例子:
LogProxy 客户端还可以通过 `ClientConf` 配置一些客户端行为相关的参数:

<div class="highlight">
<table class="colwidths-auto docutils">
<thead>
<tr>
<th class="text-left" style="width: 10%">参数名</th>
<th class="text-left" style="width: 8%">是否必需</th>
<th class="text-left" style="width: 7%">默认值</th>
<th class="text-left" style="width: 10%">类型</th>
<th class="text-left" style="width: 15%">设置函数</th>
<th class="text-left" style="width: 50%">参数说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>clientId</td>
<td>否</td>
<td style="word-wrap: break-word;">系统生成</td>
<td>String</td>
<td>clientId</td>
<td>用户自定义客户端id,默认由系统自动生成。</td>
</tr>
<tr>
<td>transferQueueSize</td>
<td>否</td>
<td style="word-wrap: break-word;">20000</td>
<td>Int</td>
<td>transferQueueSize</td>
<td>用于缓冲从LogProxy接收的记录的队列大小。</td>
</tr>
<tr>
<td>connectTimeoutMs</td>
<td>否</td>
<td style="word-wrap: break-word;">5000</td>
<td>Int</td>
<td>connectTimeoutMs</td>
<td>连接超时时间(以毫秒为单位)。</td>
</tr>
<tr>
<td>readWaitTimeMs</td>
<td>否</td>
<td style="word-wrap: break-word;">2000</td>
<td>Int</td>
<td>readWaitTimeMs</td>
<td>读取队列的超时时间(以毫秒为单位)。</td>
</tr>
<tr>
<td>retryIntervalS</td>
<td>否</td>
<td style="word-wrap: break-word;">2</td>
<td>Int</td>
<td>retryIntervalS</td>
<td>重试之间的间隔时间(以秒为单位)。</td>
</tr>
<tr>
<td>idleTimeoutS</td>
<td>否</td>
<td style="word-wrap: break-word;">15</td>
<td>Int</td>
<td>idleTimeoutS</td>
<td>Netty handler空闲超时时间(以秒为单位)。</td>
</tr>
<tr>
<td>maxReconnectTimes</td>
<td>否</td>
<td style="word-wrap: break-word;">-1</td>
<td>Int</td>
<td>maxReconnectTimes</td>
<td>断开连接后的最大重试次数,如果持续idleTimeoutS所配置的时间后,仍没有收到数据,则会触发重新连接。默认值-1代表无限重试。</td>
</tr>
<tr>
<td>nettyDiscardAfterReads</td>
<td>否</td>
<td style="word-wrap: break-word;">16</td>
<td>Int</td>
<td>nettyDiscardAfterReads</td>
<td>Netty尝试读取的最大次数,超过此次数的数据将被丢弃。</td>
</tr>
<tr>
<td>ignoreUnknownRecordType</td>
<td>否</td>
<td style="word-wrap: break-word;">false</td>
<td>boolean</td>
<td>ignoreUnknownRecordType</td>
<td>使用warning级别的日志记录未知或不受支持的消息类型,而不是抛出异常。</td>
</tr>
<tr>
<td>protocolVersion</td>
<td>否</td>
<td style="word-wrap: break-word;">2</td>
<td>Int</td>
<td>protocolVersion</td>
<td>与LogProxy服务(cdc模式)的通信协议版本。当前默认值即最新版本V2。</td>
</tr>
<tr>
<td>sslContext</td>
<td>否</td>
<td style="word-wrap: break-word;"></td>
<td>SslContext</td>
<td>sslContext</td>
<td>Netty ssl 上下文。</td>
</tr>
</tbody>
</table>
</div>

如下所示是一个使用自定义 `ClientConf` 的例子:

```java
ClientConf clientConf =
Expand Down
109 changes: 108 additions & 1 deletion docs/quickstart/logproxy-client-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,114 @@ client.join();

The method `LogProxyClient.start()` will start a new thread which serving with a netty socket to receive data from LogProxy.

There are also some configurations for the client in `ClientConf`, if you don't want to use its default values, you can customize a `ClientConf` and pass it to the corresponding constructor to create the client instance.
There are also some configurations for the client in `ClientConf`:

<div class="highlight">
<table class="colwidths-auto docutils">
<thead>
<tr>
<th class="text-left" style="width: 10%">Option</th>
<th class="text-left" style="width: 8%">Required</th>
<th class="text-left" style="width: 7%">Default</th>
<th class="text-left" style="width: 10%">Type</th>
<th class="text-left" style="width: 15%">Setter</th>
<th class="text-left" style="width: 50%">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>clientId</td>
<td>false</td>
<td style="word-wrap: break-word;">system-generated</td>
<td>String</td>
<td>clientId</td>
<td>User-defined client id, automatically generated by the system by default.</td>
</tr>
<tr>
<td>transferQueueSize</td>
<td>false</td>
<td style="word-wrap: break-word;">20000</td>
<td>Int</td>
<td>transferQueueSize</td>
<td>Queue size for storing records received from log proxy.</td>
</tr>
<tr>
<td>connectTimeoutMs</td>
<td>false</td>
<td style="word-wrap: break-word;">5000</td>
<td>Int</td>
<td>connectTimeoutMs</td>
<td>Connection timeout in milliseconds.</td>
</tr>
<tr>
<td>readWaitTimeMs</td>
<td>false</td>
<td style="word-wrap: break-word;">2000</td>
<td>Int</td>
<td>readWaitTimeMs</td>
<td>Reading queue timeout in milliseconds.</td>
</tr>
<tr>
<td>retryIntervalS</td>
<td>false</td>
<td style="word-wrap: break-word;">2</td>
<td>Int</td>
<td>retryIntervalS</td>
<td>Time to sleep in seconds when retrying.</td>
</tr>
<tr>
<td>idleTimeoutS</td>
<td>false</td>
<td style="word-wrap: break-word;">15</td>
<td>Int</td>
<td>idleTimeoutS</td>
<td>Idle timeout in seconds for netty handler.</td>
</tr>
<tr>
<td>maxReconnectTimes</td>
<td>false</td>
<td style="word-wrap: break-word;">-1</td>
<td>Int</td>
<td>maxReconnectTimes</td>
<td>Maximum number of retries after disconnect, if not data income lasting idleTimeoutS, a reconnection will be triggered. The default value -1 means infinite retries</td>
</tr>
<tr>
<td>nettyDiscardAfterReads</td>
<td>false</td>
<td style="word-wrap: break-word;">16</td>
<td>Int</td>
<td>nettyDiscardAfterReads</td>
<td>Maximum number of reads, after which data will be discarded.</td>
</tr>
<tr>
<td>ignoreUnknownRecordType</td>
<td>false</td>
<td style="word-wrap: break-word;">false</td>
<td>boolean</td>
<td>ignoreUnknownRecordType</td>
<td>Ignore unknown or unsupported record type with a warning log instead of throwing an exception.</td>
</tr>
<tr>
<td>protocolVersion</td>
<td>false</td>
<td style="word-wrap: break-word;">2</td>
<td>Int</td>
<td>protocolVersion</td>
<td>Communication protocol version with the LogProxy service (cdc mode). The current default value is the latest version V2.</td>
</tr>
<tr>
<td>sslContext</td>
<td>false</td>
<td style="word-wrap: break-word;"></td>
<td>SslContext</td>
<td>sslContext</td>
<td>Netty ssl context.</td>
</tr>
</tbody>
</table>
</div>

If you don't want to use its default values, you can customize a `ClientConf` and pass it to the corresponding constructor to create the client instance.

```java
ClientConf clientConf =
Expand Down

0 comments on commit f3ef7fb

Please sign in to comment.