Skip to content

Commit

Permalink
Lint and fix style of Markdown files in docs (#533)
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaoyang Liu <siujoeng.lau@gmail.com>
  • Loading branch information
xiaoyang-sde committed Sep 24, 2021
1 parent 99ce31d commit ef5a75b
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 51 deletions.
6 changes: 4 additions & 2 deletions docs/cn/features/https.zh-CN.md → docs/cn/features/https.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# HTTPS

1.在eventmesh-runtime 中配置

```
Expand All @@ -6,7 +8,7 @@ eventMesh.server.useTls.enabled=true //默认值 false
config env varible
-Dssl.server.protocol=TLSv1.1 //默认值 TLSv1.1
-Dssl.server.protocol=TLSv1.1 //默认值 TLSv1.1
-Dssl.server.cer=sChat2.jks //把文件放到启动脚本start.sh 指定的conPath目录下
-Dssl.server.pass=sNetty
```
Expand All @@ -24,7 +26,7 @@ LiteProducer producer = new LiteProducer(liteClientConfig);
//配置环境变量
-Dssl.client.protocol=TLSv1.1 //默认值 TLSv1.1
-Dssl.client.protocol=TLSv1.1 //默认值 TLSv1.1
-Dssl.client.cer=sChat2.jks //把文件放到应用指定的conPath目录下
-Dssl.client.pass=sNetty
```
6 changes: 3 additions & 3 deletions docs/cn/features/spi.zh-CN.md → docs/cn/features/spi.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public @interface EventMeshSPI {

### EventMeshExtensionFactory

EventMeshExtensionFactory是SPI实现类的获取工厂,包含一个静态方法getExtension(Class<T> extensionType, String extensionName),
EventMeshExtensionFactory是SPI实现类的获取工厂,包含一个静态方法`getExtension(Class<T> extensionType, String extensionName)`
接收扩展接口字节码对象和扩展实例名称,用于获取扩展接口的具体实现类。

```java
Expand All @@ -44,7 +44,7 @@ public enum EventMeshExtensionFactory {
* @param <T> the type of the plugin
* @return plugin instance
*/
public static <T> T getExtension(Class<T> extensionType, String extensionName) {
public static <T> T getExtension(Class<T> extensionType, String extensionName) {
...
}
}
Expand Down Expand Up @@ -109,4 +109,4 @@ org.apache.eventmesh.api.producer.MeshMQProducer
rocketmq=org.apache.eventmesh.connector.rocketmq.producer.RocketMQProducerImpl
```

至此,一个SPI扩展模块就完成了。在使用的时候只需要通过EventMeshExtensionFactory.getExtension(MeshMQProducer.class, “rocketmq”)就可以获取RocketMQProducerImpl实现类。
至此,一个SPI扩展模块就完成了。在使用的时候只需要通过EventMeshExtensionFactory.getExtension(MeshMQProducer.class, “rocketmq”)就可以获取RocketMQProducerImpl实现类。
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## TCP协议文档
# TCP协议文档

#### 1. 协议格式

Expand All @@ -17,7 +17,7 @@
消息头(header):长度 = headerLength
消息体(body):长度 = length - headerLength - 4 - 4
消息体(body):长度 = length - headerLength - 4 - 4
```

#### 2. 业务逻辑层
Expand Down Expand Up @@ -257,4 +257,4 @@ public class LiteMessage {

| 场景 | Server向Client发送消息请求码 | Client回复Server消息响应码 | 说明 |
| ------------------ | ---------------------------- | -------------------------- | ---------------------- |
| 客户端接收异步事件 | HTTP_PUSH_CLIENT_ASYNC(105) | retCode | retCode值为0时代表成功 |
| 客户端接收异步事件 | HTTP_PUSH_CLIENT_ASYNC(105) | retCode | retCode值为0时代表成功 |
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1>Eventmesh-runtime快速入门说明</h1>
# Eventmesh-runtime 快速入门说明

## 1 远程部署

Expand Down Expand Up @@ -65,7 +65,7 @@ sh start.sh
- eventmesh-spi : eventmesh SPI加载模块

> 注:插件模块遵循eventmesh定义的SPI规范, 自定义的SPI接口需要使用注解@EventMeshSPI标识.
> 插件实例需要在对应模块中的/main/resources/META-INF/eventmesh 下配置相关接口与实现类的映射文件,文件名为SPI接口全类名.
> 插件实例需要在对应模块中的/main/resources/META-INF/eventmesh 下配置相关接口与实现类的映射文件,文件名为SPI接口全类名.
> 文件内容为插件实例名到插件实例的映射, 具体可以参考eventmesh-connector-rocketmq插件模块
插件可以从classpath和插件目录下面加载. 在本地开发阶段可以将使用的插件在eventmesh-starter模块build.gradle中进行声明,或者执行gradle的copyConnectorPlugin任务
Expand All @@ -84,7 +84,7 @@ sh start.sh
加载**RocketMQ Connector**插件配置:

```java
#connector plugin
#connector plugin
eventMesh.connector.plugin.type=rocketmq
```

Expand Down Expand Up @@ -187,10 +187,10 @@ docker pull rocketmqinc/rocketmq-namesrv:4.5.0-alpine
#获取broker镜像
docker pull rocketmqinc/rocketmq-broker:4.5.0-alpine

#运行namerv容器
docker run -d -p 9876:9876 -v `pwd` /data/namesrv/logs:/root/logs -v `pwd`/data/namesrv/store:/root/store --name rmqnamesrv rocketmqinc/rocketmq-namesrv:4.5.0-alpine sh mqnamesrv
#运行namerv容器
docker run -d -p 9876:9876 -v `pwd` /data/namesrv/logs:/root/logs -v `pwd`/data/namesrv/store:/root/store --name rmqnamesrv rocketmqinc/rocketmq-namesrv:4.5.0-alpine sh mqnamesrv

#运行broker容器
#运行broker容器
docker run -d -p 10911:10911 -p 10909:10909 -v `pwd`/data/broker/logs:/root/logs -v `pwd`/data/broker/store:/root/store --name rmqbroker --link rmqnamesrv:namesrv -e "NAMESRV_ADDR=namesrv:9876" rocketmqinc/rocketmq-broker:4.5.0-alpine sh mqbroker -c ../conf/broker.conf
```

Expand All @@ -211,7 +211,7 @@ Linux
**通过源码的方式进行构建**

```shell
cd /* Your Deploy Path */EventMesh/eventmesh-test
cd /* Your Deploy Path */EventMesh/eventmesh-test
gradle clean testdist testtar -x test`
```

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h2>如何运行eventmesh-sdk-java演示</h2>
# 如何运行 eventmesh-sdk-java 演示

> Eventmesh-sdk-java作为客户端,与eventmesh-runtime通信,用于完成消息的发送和接收。
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Eventmesh-store快速入门说明
# Eventmesh-store 快速入门说明

### 依赖

Expand Down Expand Up @@ -50,4 +50,4 @@ cd ../bin
sh runbroker.sh
```

如果看到"The broker \[YOUR-BROKER-NAME, IP:PORT\] boot success."在../logs/broker.log中, 您可以成功设置eventmesh-store。
如果看到"The broker \[YOUR-BROKER-NAME, IP:PORT\] boot success."在../logs/broker.log中, 您可以成功设置eventmesh-store。
File renamed without changes.
43 changes: 22 additions & 21 deletions docs/en/features/eventmesh-schemaregistry-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@

### Schema

A Schema stands for the description of serialization instances(string/stream/file/...) and has two properties. First, it is also in the format of serialization type. Second, it defines what requirements such serialized instances should satisfy.
A Schema stands for the description of serialization instances(string/stream/file/...) and has two properties. First, it is also in the format of serialization type. Second, it defines what requirements such serialized instances should satisfy.

Besides describing a serialization instance, a Schema may also be used for validating whether an instance is legitimate. The reason is that it defines the ```type```(and other properties) of a serialized instance and inside keys. Taking JSON Schema for example, it could not only be referred when describing a JSON string, but also be used for validating whether a string satisfies properties defined in the schema[[1]](#References).

Commonly, there are JSON Schema, Protobuf Schema, and Avro Schema.

### Schema Registry

Schema Registry is a server provides RESTful interfaces. It could receive and store Schemas from clients, as well as provide intrefaces for other clients to retrieve Schemas from it.
Schema Registry is a server provides RESTful interfaces. It could receive and store Schemas from clients, as well as provide intrefaces for other clients to retrieve Schemas from it.

It could be applied to validation process and (de-)serialization process.

Expand All @@ -32,15 +32,13 @@ Confluentinc[[4]](#References) | In both validation and (de-)serialization proce

OpenSchema[[5]](#References) proposes a specification for data schema when exchanging the message and event in more and more modern cloud-native applications. It designs a RESTful interface for storing and retrieving such as Avro, JSON Schema, and Protobuf3 schemas from three aspects(subject/schema/compatibility).


## Requirements(Goals)

| Requirement ID | Requirement Description | Comments |
| :------------- | ------------------------------------------------------------ | ------------- |
| F-1 | In transmission, no message needs to contain schema information which bring efficiency. | Functionality |
| F-2 | The message content from producer could be validated whether serialized correctly according to schema. | Functionality |


## Design Details

### Architecture
Expand All @@ -52,27 +50,31 @@ OpenSchema[[5]](#References) proposes a specification for data schema when excha
![Process](../../images/features/eventmesh-schemaregistry-process.jpg)

The highlevel process of messages transmission undergoes 10 steps as follows:

- step1: Consumer subscribes "TOPIC" messages from EventMesh.
- step2: Producer registers a schema to EventMesh.
- step3: EventMesh registers a schema to Schema Registry.
- step4: Schema Registry returns the id of newly created schema; EventMesh caches such id and schema.
- step5: EventMesh returns the id of schema to Producer.
- step6: Producer patches the id in front of messages and send messages to EventMesh.
- step7: EventMesh validates the messages in the entry port and send it to EventStore; EventMesh retrieves messages from EventStore.
- step8: EventMesh unpatches the id and send it to Schema Registry(if such <id, schema> does not exists in local cache).
- step8: EventMesh unpatches the id and send it to Schema Registry(if such `<id, schema>` does not exists in local cache).
- step9: Schema Registry returns schema and EventMesh caches it.
- step10: EventMesh patches schema in front of messages and push it to consumer.

## Current Progress

### Status

**Current state** : Developing

**Discussion thread** : ISSUE #339

### Proposed Changes

The proposal has two aspects.

First is a separated Open Schema Registry, which includes storage and compatibility check for schema.
First is a separated Open Schema Registry, which includes storage and compatibility check for schema.
This proposal is under developing.

Second is the integration of Open Schema in Eventmesh, which includes validation for schema. This proposal is to be developed.
Expand All @@ -99,19 +101,19 @@ No. | Status Code | Exception Code | Description | status

No. | Type | URL | response | exception | code | test
--- | --- | --- | --- | --- | --- | ---
1 | GET | /schemas/ids/{string: id} | Schema.class | 40101\40401\50001 | ✔ | ❌
2 | GET | /schemas/ids/{string: id}/subjects | SubjectAndVersion.class | 40101\40401\50001 | ✔ | ❌
3 | GET | /subjects | List\<String> | 40101\50001 | ✔ | ❌
4 | GET | /subjects/{string: subject}/versions | List\<Integer> | 40101\40402\50001 | ✔ | ❌
5 | DELETE | /subjects/(string: subject) | List\<Integer> | 40101\40402\50001 | ✔ | ❌
6 | GET | /subjects/(string: subject) | Subject.class | 40101\40402\50001 | ✔ | ❌
7 | GET | /subjects/(string: subject)/versions/(version: version)/schema | SubjectWithSchema.class | 40101\40402\40403\50001 | ✔ | ❌
8 | POST | /subjects/(string: subject)/versions | SchemaIdResponse.class | 40101\40901\42201\50001\50002 | - | ❌
9 | POST | /subjects/(string: subject)/ | Subject.class | 40101\40901\42202\50001\50002 | ✔ | ❌
10 | DELETE | /subjects/(string: subject)/versions/(version: version) | int | 40101\40402\40403\40901\50001| - | ❌
11 | POST | /compatibility/subjects/(string: subject)/versions/(version: version) | CompatibilityResultResponse.class | 40101\40402\40403\42201\42203\50001| - | ❌
12 | GET | /compatibility/(string: subject) | Compatibility.class | 40101\40402\50001 | ✔ | ❌
13 | PUT | /compatibility/(string: subject) | Compatibility.class | 40101\40402\40901\42204\50001 | - | ❌
1 | GET | /schemas/ids/{string: id} | `Schema.class` | 40101\40401\50001 | ✔ | ❌
2 | GET | /schemas/ids/{string: id}/subjects | `SubjectAndVersion.class` | 40101\40401\50001 | ✔ | ❌
3 | GET | /subjects | `List\<String>` | 40101\50001 | ✔ | ❌
4 | GET | /subjects/{string: subject}/versions | `List\<Integer>` | 40101\40402\50001 | ✔ | ❌
5 | DELETE | /subjects/(string: subject) | `List\<Integer>` | 40101\40402\50001 | ✔ | ❌
6 | GET | /subjects/(string: subject) | `Subject.class` | 40101\40402\50001 | ✔ | ❌
7 | GET | /subjects/(string: subject)/versions/(version: version)/schema | `SubjectWithSchema.class` | 40101\40402\40403\50001 | ✔ | ❌
8 | POST | /subjects/(string: subject)/versions | `SchemaIdResponse.class` | 40101\40901\42201\50001\50002 | - | ❌
9 | POST | /subjects/(string: subject)/ | `Subject.class` | 40101\40901\42202\50001\50002 | ✔ | ❌
10 | DELETE | /subjects/(string: subject)/versions/(version: version) | `int` | 40101\40402\40403\40901\50001| - | ❌
11 | POST | /compatibility/subjects/(string: subject)/versions/(version: version) | `CompatibilityResultResponse.class` | 40101\40402\40403\42201\42203\50001| - | ❌
12 | GET | /compatibility/(string: subject) | `Compatibility.class` | 40101\40402\50001 | ✔ | ❌
13 | PUT | /compatibility/(string: subject) | `Compatibility.class` | 40101\40402\40901\42204\50001 | - | ❌

**Overall Project Structure**

Expand All @@ -123,8 +125,8 @@ No. | Type | URL | response | exception | code | test

![Project_Structure](../../images/features/eventmesh-schemaregistry-projectstructure.png)


## References

[1] [schema validator (github.com)](https://github.com/search?q=schema+validator)

[2] [EMQ : Schema Registry](https://www.jianshu.com/p/33e0655c642b)
Expand All @@ -134,4 +136,3 @@ No. | Type | URL | response | exception | code | test
[4] [confluentinc/schema-registry](https://github.com/confluentinc/schema-registry)

[5] [openmessaging/openschema](https://github.com/openmessaging/openschema)

4 changes: 3 additions & 1 deletion docs/en/features/https.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# HTTPS

1.config in eventmesh-runtime

```
Expand All @@ -7,7 +9,7 @@ eventMesh.server.useTls.enabled=true //default value is false
config env varible
-Dssl.server.protocol=TLSv1.1 //default value is TLSv1.1
-Dssl.server.cer=sChat2.jks //put the file in confPath which is configured in start.sh
-Dssl.server.cer=sChat2.jks //put the file in confPath which is configured in start.sh
-Dssl.server.pass=sNetty
```
Expand Down
12 changes: 6 additions & 6 deletions docs/en/features/spi.en-US.md → docs/en/features/spi.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Introduction

In order to improve scalability,EventMesh introduce the SPI(Service Provider Interface)mechanism, which can help to automatically find the concrete implementation
class of the extended interface at runtime and load it dynamically. In EventMesh, all extension modules are implemented by using plugin.
class of the extended interface at runtime and load it dynamically. In EventMesh, all extension modules are implemented by using plugin.
User can develop custom plugins by simply implementing extended interfaces, and select the plugin to be run at runtime by simply declare at configuration.

## eventmesh-spi module
Expand Down Expand Up @@ -33,7 +33,7 @@ If this attribute is true, that means the instance of this interface will be sin

### EventMeshExtensionFactory

EventMeshExtensionFactory is a factory used to get the SPI extension instance which contains a static method getExtension(Class<T> extensionType, String extensionName).
EventMeshExtensionFactory is a factory used to get the SPI extension instance which contains a static method `getExtension(Class<T> extensionType, String extensionName)`.

```java
public enum EventMeshExtensionFactory {
Expand All @@ -44,7 +44,7 @@ public enum EventMeshExtensionFactory {
* @param <T> the type of the plugin
* @return plugin instance
*/
public static <T> T getExtension(Class<T> extensionType, String extensionName) {
public static <T> T getExtension(Class<T> extensionType, String extensionName) {
...
}
}
Expand Down Expand Up @@ -84,7 +84,7 @@ In the future, we might support the implementation to load from the maven reposi

The following is an example of how to use the SPI to declare a plugin.

First, we create an eventmesh-connector-api module, and define the extension interface MeshMQProducer, and we use @EventMeshSPI on the MeshMQProducer,
First, we create an eventmesh-connector-api module, and define the extension interface MeshMQProducer, and we use @EventMeshSPI on the MeshMQProducer,
which indicates the MeshMQProducer is an SPI interface.

```java
Expand All @@ -102,7 +102,7 @@ public class RocketMQProducerImpl implements MeshMQProducer {
}
```

At the same time, we need to create a file with the full qualified name of the SPI interface under the resource/META-INF/eventmesh directory
At the same time, we need to create a file with the full qualified name of the SPI interface under the resource/META-INF/eventmesh directory
in the eventmesh-connector-rocketmq module.

org.apache.eventmesh.api.producer.MeshMQProducer
Expand All @@ -114,4 +114,4 @@ rocketmq=org.apache.eventmesh.connector.rocketmq.producer.RocketMQProducerImpl
```

At this point, an SPI expansion module is complete. We can use `EventMeshExtensionFactory.getExtension(MeshMQProducer.class, “rocketmq”)`
to get the RocketMQProducerImpl instance.
to get the RocketMQProducerImpl instance.
8 changes: 4 additions & 4 deletions docs/en/instructions/eventmesh-runtime-protocol.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## TCP Protocol Document In Eventmesh-Runtime
# TCP Protocol Document In Eventmesh-Runtime

#### 1. Protocol Format

Expand All @@ -15,9 +15,9 @@ Message Size: 4 bit, the total length of message
Header Size: 4 bit,the length of Message Header
Message Header: the specific header content of message
Message Header: the specific header content of message
Message Body: the specific body content of message
Message Body: the specific body content of message
```

#### 2. Message Object in business logic layer
Expand Down Expand Up @@ -258,4 +258,4 @@ same with RequestHeader of Heartbeat Msg

| Scene | Server Send | Client Reply | Remark |
| ------------------ | ---------------------------- | -------------------------- | ---------------------- |
| Push async msg to client | HTTP_PUSH_CLIENT_ASYNC(105) | retCode | retCode=0,send success |
| Push async msg to client | HTTP_PUSH_CLIENT_ASYNC(105) | retCode | retCode=0,send success |
2 changes: 1 addition & 1 deletion docs/en/instructions/eventmesh-sdk-java-quickstart.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## How to run eventmesh-sdk-java demo
# How to run eventmesh-sdk-java demo

> Eventmesh-sdk-java , as the client, communicated with eventmesh-runtime, used to complete the sending and receiving of message.
>
Expand Down

0 comments on commit ef5a75b

Please sign in to comment.