Skip to content

Commit 6040927

Browse files
committed
Update README.md
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
1 parent 4c157a0 commit 6040927

File tree

1 file changed

+48
-1
lines changed

1 file changed

+48
-1
lines changed

README.md

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,48 @@
1-
# OpenSergo Java SDK
1+
<img src="https://user-images.githubusercontent.com/9434884/197435179-bbda0a82-6bae-485e-ac1a-490fee91a002.png" alt="OpenSergo Logo" width="50%">
2+
3+
# OpenSergo Java SDK
4+
5+
[![OpenSergo Java SDK CI](https://github.com/opensergo/opensergo-java-sdk/actions/workflows/ci.yml/badge.svg)](https://github.com/opensergo/opensergo-java-sdk/actions/workflows/ci.yml)
6+
[![Maven Central](https://img.shields.io/maven-central/v/io.opensergo/opensergo-java-sdk.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22io.opensergo%22%20AND%20a:%22opensergo-java-sdk%22)
7+
[![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)
8+
9+
## Introduction
10+
11+
## Documentation
12+
13+
See the [OpenSergo Website](https://opensergo.io/) for the official website of OpenSergo.
14+
15+
See the [中文文档](https://opensergo.io/zh-cn/) for document in Chinese.
16+
17+
## Quick Start
18+
19+
1. Add dependency in Maven `pom.xml`:
20+
21+
```xml
22+
<!-- replace here with the latest version -->
23+
<dependency>
24+
<groupId>io.opensergo</groupId>
25+
<artifactId>opensergo-java-sdk</artifactId>
26+
<version>0.1.0-alpha</version>
27+
</dependency>
28+
```
29+
30+
2. Subscribe data from OpenSergo control plane:
31+
32+
```java
33+
// 1. Create client with remote host and port of OpenSergo control plane
34+
OpenSergoClient client = new OpenSergoClient(host, port);
35+
// 2. Start the OpenSergo client.
36+
client.start();
37+
38+
// 3. Subscribe the config of the target (namespace, appName, kind)
39+
client.subscribeConfig(new SubscribeKey("default", "my-service", configKind),
40+
new OpenSergoConfigSubscriber() {
41+
@Override
42+
public boolean onConfigUpdate(SubscribeKey subscribeKey, Object dataList) {
43+
// Handle received config here
44+
System.out.println("key: " + subscribeKey + ", data: " + dataList);
45+
return true;
46+
}
47+
});
48+
```

0 commit comments

Comments
 (0)