@@ -6,12 +6,24 @@ OceanBase Log Client is a library for obtaining log of [OceanBase](https://githu
...
@@ -6,12 +6,24 @@ OceanBase Log Client is a library for obtaining log of [OceanBase](https://githu
Getting Started
Getting Started
---------------
---------------
There are modules as following:
### Work with LogProxy
-`common`: some common utils
#### Use LogProxyClient
-`logproxy-client`: the client for [oblogproxy](https://github.com/oceanbase/oblogproxy)
You can try the `logproxy-client` following the [LogProxyClient Tutorial](docs/quickstart/logproxy-client-tutorial.md).
You can use `logproxy-client` with [oblogproxy](https://github.com/oceanbase/oblogproxy) to get the commit log of OceanBase cluster, see the [tutorial](docs/quickstart/logproxy-client-tutorial.md) for more details.
#### Version Compatibility
`oblogproxy` compresses the record data from `1.0.1`, and `logproxy-client` fixed the decompression process with [#33](https://github.com/oceanbase/oblogclient/pull/33) from `1.0.4`, so there is a version compatibility as follows:
@@ -47,12 +47,6 @@ If you'd rather like the latest snapshots of the upcoming major version, use our
...
@@ -47,12 +47,6 @@ If you'd rather like the latest snapshots of the upcoming major version, use our
</repositories>
</repositories>
```
```
## Workflow
![image](../images/logproxy-client-workflow.png)
When `LogProxyClient.start()` is executed, a new thread will be created in `ClientStream`. The thread will initialize a netty channel which will receive log data from LogProxy and put the data as `TransferPacket` to a BlockingQueue. When the netty connection is established, the thread will poll the queue and pass the `LogMessage` in TransferPacket to `RecordListener.notify`.
## Usage
## Usage
### Basic Usage
### Basic Usage
...
@@ -70,18 +64,34 @@ To connect to LogProxy, there are some parameters to set in `ObReaderConfig`:
...
@@ -70,18 +64,34 @@ To connect to LogProxy, there are some parameters to set in `ObReaderConfig`:
These parameters are used in `obcdc` (former `liboblog`), and the items not listed above can be passed to `obcdc` through the `ObReaderConfig` constructor with parameters.
These parameters are used in `obcdc` (former `liboblog`), and the items not listed above can be passed to `obcdc` through the `ObReaderConfig` constructor with parameters.
Here is an example to set ObReaderConfig with a user of sys tenant, and the OceanBase and LogProxy server are on the same machine.
Here is an example to set `ObReaderConfig` with OceanBase Community Edition:
```java
```java
ObReaderConfigconfig=newObReaderConfig();
// obcdc params that are not listed above can be passed through the constructor
The method `LogProxyClient.start()` will start a new thread which serving with a netty socket to receive data from LogProxy.
The method `LogProxyClient.start()` will start a new thread which serving with a netty socket to receive data from LogProxy.
For details about `LogMessage`, see [LogMessage](../formats/logmessage.md).
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.