Skip to content

Commit

Permalink
[ISSUE #151] Adjust the categories sequence of sidebar and optimize S…
Browse files Browse the repository at this point in the history
…DK docs (#152)

* Adjust the 'Quick Start' category to the top of sidebar

* Correct some typos and format with pangu

* Translate and optimize sdk doc

* Standardize 'EventMesh Runtime'
  • Loading branch information
Pil0tXia authored Dec 15, 2023
1 parent 3a76dd9 commit d49e1a5
Show file tree
Hide file tree
Showing 22 changed files with 238 additions and 210 deletions.
4 changes: 2 additions & 2 deletions docs/instruction/03-runtime.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# EventMesh Runtime

The EventMesh Runtime is a stateful mesh node in an EventMesh cluster that is responsible for event transfer between the Source Connector and the Sink Connector, and can use EventMesh Storage as a storage queue for events.
The EventMesh Runtime is a stateful mesh node in an EventMesh cluster that is responsible for event transfer between the Source Connector and the Sink Connector, and can use Event Store as a storage queue for events.

![EventMesh Runtime](/images/design-document/runtime.png)

Expand All @@ -26,7 +26,7 @@ Download and extract the source code of the latest release from [EventMesh downl
- eventmesh-common : eventmesh public classes and methods module
- eventmesh-connector-api : eventmesh connector plugin interface definition module
- eventmesh-connector-plugin : eventmesh connector plugin module
- eventmesh-runtime : eventmesh runtime module
- eventmesh-runtime : EventMesh Runtime module
- eventmesh-sdk-java : eventmesh java client sdk
- eventmesh-starter : eventmesh local startup and runtime project portal
- eventmesh-spi : eventmesh SPI loader module
Expand Down
2 changes: 1 addition & 1 deletion docs/instruction/04-runtime-with-docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ sudo touch rocketmq-client.properties

### 4. Configure `eventmesh.properties`

The `eventmesh.properties` file contains the properties of EventMesh runtime environment and integrated plugins. Please refer to the [default configuration file](https://github.com/apache/eventmesh/blob/master/eventmesh-runtime/conf/eventmesh.properties) for the available configuration keys.
The `eventmesh.properties` file contains the properties of EventMesh Runtime environment and integrated plugins. Please refer to the [default configuration file](https://github.com/apache/eventmesh/blob/master/eventmesh-runtime/conf/eventmesh.properties) for the available configuration keys.

```shell
sudo vim eventmesh.properties
Expand Down
59 changes: 38 additions & 21 deletions docs/instruction/05-demo.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Run eventmesh-sdk-java demo
# Run Java SDK Demo

[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.apache.eventmesh/eventmesh-sdk-java/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.apache.eventmesh/eventmesh-sdk-java)

> EventMesh-sdk-java as the clientand comminucate with eventmesh-runtime,to finish the message sub and pub
> eventmesh-sdk-java acts as a client of EventMesh Runtime and communicates with it, to publish and subscribe the messages.
>
> EventMesh-sdk-java support both async and broadcast.
> The eventmesh-sdk-java supports ASYNC messages and BROADCAST messages. ASYNC messages indicate that producers only send messages and do not care about receiving reply messages. BROADCAST messages mean that producers send a message once, and all consumers subscribed to the broadcast topic will receive the message.
>
> EventMesh-sdk-java support HTTP, TCP and gRPC.
> eventmesh-sdk-java supports HTTP, TCP and gRPC protocols.
The test demos of TCP, HTTP GRPC are in the module **eventmesh-examples**:
The test demos of TCP, HTTP and GRPC are in the module `eventmesh-examples`.

## 1. TCP DEMO
## 1. TCP

### 1.1 ASYNC

Expand Down Expand Up @@ -42,8 +42,11 @@ Run the main method of org.apache.eventmesh.tcp.demo.pub.eventmeshmessage.AsyncP

More information about EventMesh-TCP, please refer to [EventMesh TCP](../sdk-java/03-tcp.md)

## 2 HTTP

## 2 HTTP DEMO
>For HTTP, the eventmesh-sdk-java implements sending and subscribing to asynchronous events.
>
>In the demo, the `content` field of the Java class `LiteMessage` represents a special protocol. Therefore, if you are using the eventmesh-sdk-java's http-client, you only need to design the content of the protocol and provide the consumer's application at the same time.
### 2.1 ASYNC

Expand All @@ -60,9 +63,17 @@ Run the main method of org.apache.eventmesh.http.demo.pub.eventmeshmessage.Async
```
More information about EventMesh-HTTP, please refer to [EventMesh HTTP](../sdk-java/02-http.md)

## 3 GRPC DEMO
## 3 GRPC

>The eventmesh-sdk-java implements the gRPC protocol. It can asynchronously or synchronously send events to the EventMesh Runtime.
>
>It can subscribe to consume events through Webhook and event streaming, and also supports the CNCF CloudEvents protocol.
### 3.1 ASYNC Publish & Webhook Subscribe

### 3.1 ASYNC PUBLISH & WEBHOOK SUBSCRIBE
>Producers can asynchronously send events to the EventMesh Runtime without waiting for the events to be stored in the `event-store`.
>
>For Webhook consumers, events will be pushed to the consumer's HTTP Endpoint URL, i.e., the consumer's `subscribeUrl`. This method is similar to the previously mentioned Http eventmesh client.
- Start publisher to publish message (we have created the topic TEST-TOPIC-GRPC-ASYNC by default, you can also create other topic to test)

Expand All @@ -76,7 +87,11 @@ Run the main method of org.apache.eventmesh.grpc.pub.eventmeshmessage.AsyncPubli
Run the main method of org.apache.eventmesh.grpc.sub.app.SpringBootDemoApplication
```

### 3.2 SYNC PUBLISH & STREAM SUBSCRIBE
### 3.2 SYNC Publish & Stream Subscribe

>Producers synchronously send events to the EventMesh Runtime while waiting for the events to be stored in the `event-store`.
>
>For event stream consumers, events are pushed in a streaming to the `ReceiveMsgHook` client. This method is similar to the eventmesh client.
- Start Request-Reply publisher to publish message (we have created the topic TEST-TOPIC-GRPC-RR by default, you can also create other topic to test)

Expand All @@ -90,19 +105,21 @@ Run the main method of org.apache.eventmesh.grpc.pub.eventmeshmessage.RequestRep
Run the main method of org.apache.eventmesh.grpc.sub.EventmeshAsyncSubscribe
```

### 3.3 PUBLISH BATCH MESSAGE
### 3.3 Publish BATCH Message

>Asynchronously batch publish multiple events to the EventMesh Runtime.
- Start publisher to publish batch message (we have created the TEST-TOPIC-GRPC-ASYNC by default, you can also create other topic to test)
- Start publisher to publish batch message (we have created the TEST-TOPIC-GRPC-ASYNC by default, you can also create other topic to test.)

```
Run the main method of org.apache.eventmesh.grpc.pub.eventmeshmessage.BatchPublishInstance
```

More information about EventMesh-gRPC, please refer to [EventMesh gRPC](../sdk-java/04-grpc.md)
More information about EventMesh-gRPC, please refer to [EventMesh gRPC](../sdk-java/04-grpc.md).

## 4. Run these demos by yourself
## 4. Run Demo with shell scripts

Please refer to [EventMesh Store](./01-store.md) and [EventMesh Runtime](./03-runtime.md) to finish the necessary deployment before try our demo
Please refer to [EventMesh Store](./01-store.md) and [EventMesh Runtime](./03-runtime.md) to finish the necessary deployment before try our demo.

After finishing the deployment of store and runtime, you can run our demos in module `eventmesh-examples`:

Expand All @@ -118,7 +135,7 @@ cd ./dist/bin
![demo_1](/images/install/demo_1.png)

### 4.1 TCP
TCP Sub
#### TCP Sub

```shell
bash tcp_eventmeshmessage_sub.sh
Expand All @@ -131,7 +148,7 @@ tail -f demo_tcp_pub.out
```
![demo_2](/images/install/demo_2.png)

TCP Pub
#### TCP Pub

```shell
bash tcp_pub_eventmeshmessage.sh
Expand All @@ -147,7 +164,7 @@ tail -f demo_tcp_sub.out

### 4.2 TCP Broadcast

TCP Sub Broadcast
#### TCP Sub Broadcast

```shell
sh tcp_sub_eventmeshmessage_broadcast.sh
Expand All @@ -161,7 +178,7 @@ tail -f demo_tcp_sub_broadcast.out

![demo_4](/images/install/demo_4.png)

TCP Pub Broadcast
#### TCP Pub Broadcast

```shell
sh tcp_pub_eventmeshmessage_broadcast.sh
Expand All @@ -177,7 +194,7 @@ tail -f demo_tcp_pub_broadcast.out

### 4.3 HTTP

HTTP Sub
#### HTTP Sub

```shell
sh http_sub.sh
Expand All @@ -191,7 +208,7 @@ tail -f demo_http_sub.out

![demo_6](/images/install/demo_6.png)

HTTP Pub
#### HTTP Pub

```shell
sh http_pub_eventmeshmessage.sh
Expand Down
10 changes: 6 additions & 4 deletions docs/sdk-java/02-http.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# HTTP Protocol

EventMesh SDK for Java implements the HTTP producer and consumer of asynchronous messages. Both the producer and consumer require an instance of `EventMeshHttpClientConfig` class that specifies the configuration of EventMesh HTTP client. The `liteEventMeshAddr`, `userName`, and `password` fields should match the `eventmesh.properties` file of EventMesh runtime.
EventMesh SDK for Java implements the HTTP producer and consumer of asynchronous messages. Both the producer and consumer require an instance of `EventMeshHttpClientConfig` class that specifies the configuration of EventMesh HTTP client. The `liteEventMeshAddr`, `userName`, and `password` fields should match the `eventmesh.properties` file of EventMesh Runtime.

```java
import org.apache.eventmesh.client.http.conf.EventMeshHttpClientConfig;
Expand Down Expand Up @@ -53,7 +53,7 @@ public class HTTP {
}
```

The EventMesh runtime will send a POST request that contains the message in the [CloudEvents format](https://github.com/cloudevents/spec) to the callback URL. The [`SubController.java` file](https://github.com/apache/eventmesh/blob/master/eventmesh-examples/src/main/java/org/apache/eventmesh/http/demo/sub/controller/SubController.java) implements a Spring Boot controller that receives and parses the callback messages.
The EventMesh Runtime will send a POST request that contains the message in the [CloudEvents format](https://github.com/cloudevents/spec) to the callback URL. The [`SubController.java` file](https://github.com/apache/eventmesh/blob/master/eventmesh-examples/src/main/java/org/apache/eventmesh/http/demo/sub/controller/SubController.java) implements a Spring Boot controller that receives and parses the callback messages.

## HTTP Producer

Expand Down Expand Up @@ -103,13 +103,15 @@ You can also publish/subscribe event without eventmesh SDK.
curl -H "Content-Type:application/json" -X POST -d '{"name": "admin", "pass":"12345678"}' http://127.0.0.1:10105/eventmesh/publish/TEST-TOPIC-HTTP-ASYNC
```

After you start the eventmesh runtime server, you can use the curl command publish the event to the specific topic with the HTTP POST method and the package body must be in JSON format. The publish url like (http://127.0.0.1:10105/eventmesh/publish/TEST-TOPIC-HTTP-ASYNC), and you will get the publish successful result.
After you start the EventMesh Runtime server, you can use the curl command publish the event to the specific topic with the HTTP POST method and the package body must be in JSON format. The publish url like (http://127.0.0.1:10105/eventmesh/publish/TEST-TOPIC-HTTP-ASYNC), and you will get the publish successful result.

### Subscribe

```shell
curl -H "Content-Type:application/json" -X POST -d '{"url": "http://127.0.0.1:8088/sub/test", "consumerGroup":"TEST-GROUP", "topic":[{"mode":"CLUSTERING","topic":"TEST-TOPIC-HTTP-ASYNC","type":"ASYNC"}]}' http://127.0.0.1:10105/eventmesh/subscribe/local
```

After you start the eventmesh runtime server, you can use the curl command to subscribe the specific topic list with the HTTP POST method, and the package body must be in JSON format. The subscribe url like (http://127.0.0.1:10105/eventmesh/subscribe/local), and you will get the subscribe successful result. You should pay attention to the `url` field in the package body, which means you need to set up an HTTP service at the specified URL, you can see the example in the `eventmesh-examples` module.
After you start the EventMesh Runtime server, you can use the curl command to subscribe the specific topic list with the HTTP POST method, and the package body must be in JSON format. The subscribe url like (http://127.0.0.1:10105/eventmesh/subscribe/local), and you will get the subscribe successful result. You should pay attention to the `url` field in the package body, which means you need to set up an HTTP service at the specified URL.

You can see the example in the `eventmesh-examples` module.

2 changes: 1 addition & 1 deletion docs/sdk-java/03-tcp.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# TCP Protocol

EventMesh SDK for Java implements the TCP producer and consumer of synchronous, asynchronous, and broadcast messages. Both the producer and consumer require an instance of `EventMeshTCPClientConfig` class that specifies the configuration of EventMesh TCP client. The `host` and `port` fields should match the `eventmesh.properties` file of EventMesh runtime.
EventMesh SDK for Java implements the TCP producer and consumer of synchronous, asynchronous, and broadcast messages. Both the producer and consumer require an instance of `EventMeshTCPClientConfig` class that specifies the configuration of EventMesh TCP client. The `host` and `port` fields should match the `eventmesh.properties` file of EventMesh Runtime.

```java
import org.apache.eventmesh.client.tcp.conf.EventMeshTCPClientConfig;
Expand Down
6 changes: 3 additions & 3 deletions docs/sdk-java/04-grpc.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# gRPC Protocol

EventMesh SDK for Java implements the gRPC producer and consumer of synchronous, asynchronous, and broadcast messages. Both the producer and consumer require an instance of `EventMeshGrpcClientConfig` class that specifies the configuration of EventMesh gRPC client. The `liteEventMeshAddr`, `userName`, and `password` fields should match the `eventmesh.properties` file of EventMesh runtime.
EventMesh SDK for Java implements the gRPC producer and consumer of synchronous, asynchronous, and broadcast messages. Both the producer and consumer require an instance of `EventMeshGrpcClientConfig` class that specifies the configuration of EventMesh gRPC client. The `liteEventMeshAddr`, `userName`, and `password` fields should match the `eventmesh.properties` file of EventMesh Runtime.

```java
import org.apache.eventmesh.client.grpc.config.EventMeshGrpcClientConfig;
Expand All @@ -24,7 +24,7 @@ public class CloudEventsAsyncSubscribe implements ReceiveMsgHook<CloudEvent> {

### Stream Consumer

The EventMesh runtime sends the message from producers to the stream consumer as a series of event streams. The consumer should implement the `ReceiveMsgHook` class, which is defined in [`ReceiveMsgHook.java`](https://github.com/apache/eventmesh/blob/master/eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/grpc/consumer/ReceiveMsgHook.java).
The EventMesh Runtime sends the message from producers to the stream consumer as a series of event streams. The consumer should implement the `ReceiveMsgHook` class, which is defined in [`ReceiveMsgHook.java`](https://github.com/apache/eventmesh/blob/master/eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/grpc/consumer/ReceiveMsgHook.java).

```java
public interface ReceiveMsgHook<T> {
Expand Down Expand Up @@ -77,7 +77,7 @@ public class CloudEventsAsyncSubscribe implements ReceiveMsgHook<CloudEvent> {

### Webhook Consumer

The `subscribe` method of the `EventMeshGrpcConsumer` class accepts a list of `SubscriptionItem` that defines the topics to be subscribed and an optional callback URL. If the callback URL is provided, the EventMesh runtime will send a POST request that contains the message in the [CloudEvents format](https://github.com/cloudevents/spec) to the callback URL. The [`SubController.java` file](https://github.com/apache/eventmesh/blob/master/eventmesh-examples/src/main/java/org/apache/eventmesh/grpc/sub/app/controller/SubController.java) implements a Spring Boot controller that receives and parses the callback messages.
The `subscribe` method of the `EventMeshGrpcConsumer` class accepts a list of `SubscriptionItem` that defines the topics to be subscribed and an optional callback URL. If the callback URL is provided, the EventMesh Runtime will send a POST request that contains the message in the [CloudEvents format](https://github.com/cloudevents/spec) to the callback URL. The [`SubController.java` file](https://github.com/apache/eventmesh/blob/master/eventmesh-examples/src/main/java/org/apache/eventmesh/grpc/sub/app/controller/SubController.java) implements a Spring Boot controller that receives and parses the callback messages.

```java
import org.apache.eventmesh.client.grpc.consumer.EventMeshGrpcConsumer;
Expand Down
2 changes: 1 addition & 1 deletion docs/upgrade-guide/01-upgrade-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

## 2. Service upgrade installation

The upgrade and startup of the EventMesh runtime module can be done in accordance with the [deployment guide](https://eventmesh.apache.org/docs/instruction/runtime).
The upgrade and startup of the EventMesh Runtime module can be done in accordance with the [deployment guide](https://eventmesh.apache.org/docs/instruction/runtime).

For differences and changes between versions, please refer to the [release notes](https://eventmesh.apache.org/events/release-notes) of different versions. Compatibility between versions can be achieved.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Eventmesh-runtime 快速入门说明

EventMesh Runtime 是 EventMesh 集群中有状态的 Mesh 节点,负责 Source Connector 与 Sink Connector 之间的事件传输,并可以使用 EventMesh Storage 作为事件的存储队列。
EventMesh Runtime 是 EventMesh 集群中有状态的 Mesh 节点,负责 Source Connector 与 Sink Connector 之间的事件传输,并可以使用 Event Store 作为事件的存储队列。

![EventMesh Runtime](/images/design-document/runtime.png)

Expand Down
Loading

0 comments on commit d49e1a5

Please sign in to comment.