Skip to content

Commit

Permalink
[ISSUE #265]rename proxy field to eventmesh
Browse files Browse the repository at this point in the history
  • Loading branch information
MajorHe1 committed Apr 8, 2021
1 parent 4ed546f commit 67847fe
Show file tree
Hide file tree
Showing 147 changed files with 3,124 additions and 3,157 deletions.
4 changes: 2 additions & 2 deletions docs/cn/features/https.zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
1.在eventmesh-runtime 中配置

```
proxy.properties(添加如下配置)
proxy.server.useTls.enabled=true //默认值 false
eventMesh.properties(添加如下配置)
eventMesh.server.useTls.enabled=true //默认值 false
config env varible
Expand Down
8 changes: 4 additions & 4 deletions docs/cn/instructions/eventmesh-runtime-protocol.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,10 @@ public class LiteMessage {

| 场景 | Client向Server发送消息请求码 | Server回复Client消息的响应码 | 说明 |
| ------------ | ---------------------------- | --------------------------------------- | ---- |
| 心跳 | HEARTBEAT(203) | SUCCESS(0)/PROXY_HEARTBEAT_ERROR(19) | |
| 订阅 | SUBSCRIBE(206) | SUCCESS(0)/PROXY_SUBSCRIBE_ERROR(17) | |
| 取消订阅 | UNSUBSCRIBE(207) | SUCCESS(0)/PROXY_UNSUBSCRIBE_ERROR(18) | |
| 发送异步事件 | MSG_SEND_ASYNC(104) | SUCCESS(0)/PROXY_SEND_ASYNC_MSG_ERR(14) | |
| 心跳 | HEARTBEAT(203) | SUCCESS(0)/EVENTMESH_HEARTBEAT_ERROR(19) | |
| 订阅 | SUBSCRIBE(206) | SUCCESS(0)/EVENTMESH_SUBSCRIBE_ERROR(17) | |
| 取消订阅 | UNSUBSCRIBE(207) | SUCCESS(0)/EVENTMESH_UNSUBSCRIBE_ERROR(18) | |
| 发送异步事件 | MSG_SEND_ASYNC(104) | SUCCESS(0)/EVENTMESH_SEND_ASYNC_MSG_ERR(14) | |



Expand Down
22 changes: 11 additions & 11 deletions docs/cn/instructions/eventmesh-runtime-quickstart.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ gradle clean dist tar -x test
upload eventmesh-runtime_1.0.0.tar.gz
tar -zxvf eventmesh-runtime_1.0.0.tar.gz
cd bin
配置 proxy.properties
配置 eventMesh.properties
cd ../bin
sh start.sh
```
如果看到"ProxyTCPServer[port=10000] started....",则说明设置成功。
如果看到"EventMeshTCPServer[port=10000] started....",则说明设置成功。



Expand Down Expand Up @@ -107,37 +107,37 @@ dependencies {

### 3.2 配置

> **预先准备** : 你可能需要从github上下载源代码,并参考这两个文件(proxy.properties 和 rocketmq-client.properties)的内容来做下面的操作
> **预先准备** : 你可能需要从github上下载源代码,并参考这两个文件(eventMesh.properties 和 rocketmq-client.properties)的内容来做下面的操作
**3.2.1 需要配置的文件**

在运行容器之前,你需要配置如下文件:

**proxy.properties**
**eventMesh.properties**

| 配置项 | 默认值 | 备注 |
| ---------------------- | ------ | ----------------------- |
| proxy.server.http.port | 10105 | EventMesh http 服务端口 |
| proxy.server.tcp.port | 10000 | EventMesh tcp 服务端口 |
| eventMesh.server.http.port | 10105 | EventMesh http 服务端口 |
| eventMesh.server.tcp.port | 10000 | EventMesh tcp 服务端口 |

**rocketmq-client.properties**

| 配置项 | 默认值 | 备注 |
| --------------------------------- | ----------------------------- | --------------------- |
| proxy.server.rocketmq.namesrvAddr | 127.0.0.1:9876;127.0.0.1:9876 | RocketMQ namesrv 地址 |
| eventMesh.server.rocketmq.namesrvAddr | 127.0.0.1:9876;127.0.0.1:9876 | RocketMQ namesrv 地址 |

拉取了EventMesh镜像到你的宿主机后,你可以执行下面的命令来完成**proxy.properties****rocketmq-client.properties** 文件的配置
拉取了EventMesh镜像到你的宿主机后,你可以执行下面的命令来完成**eventMesh.properties****rocketmq-client.properties** 文件的配置

**3.2.2 创建文件**

```shell
mkdir -p /data/eventmesh/rocketmq/conf
cd /data/eventmesh/rocketmq/conf
vi proxy.properties
vi eventMesh.properties
vi rocketmq-client.properties
```

这两个文件内容可以参考 [proxy.properties](https://github.com/WeBankFinTech/EventMesh/blob/develop/eventmesh-runtime/conf/proxy.properties)[rocketmq-client.properties](https://github.com/WeBankFinTech/EventMesh/blob/develop/eventmesh-runtime/conf/rocketmq-client.properties)
这两个文件内容可以参考 [eventMesh.properties](https://github.com/WeBankFinTech/EventMesh/blob/develop/eventmesh-runtime/conf/eventMesh.properties)[rocketmq-client.properties](https://github.com/WeBankFinTech/EventMesh/blob/develop/eventmesh-runtime/conf/rocketmq-client.properties)

### 3.3 运行

Expand All @@ -146,7 +146,7 @@ vi rocketmq-client.properties
执行下面的命令来运行容器

```shell
docker run -d -p 10000:10000 -p 10105:10105 -v /data/eventmesh/rocketmq/conf/proxy.properties:/data/app/eventmesh/conf/proxy.properties -v /data/eventmesh/rocketmq/conf/rocketmq-client.properties:/data/app/eventmesh/conf/rocketmq-client.properties docker.io/eventmesh/eventmesh-rocketmq:v1.2.0
docker run -d -p 10000:10000 -p 10105:10105 -v /data/eventmesh/rocketmq/conf/eventMesh.properties:/data/app/eventmesh/conf/eventMesh.properties -v /data/eventmesh/rocketmq/conf/rocketmq-client.properties:/data/app/eventmesh/conf/rocketmq-client.properties docker.io/eventmesh/eventmesh-rocketmq:v1.2.0
```

> -p : 将容器内端口与宿主机端口绑定,容器的端口应与配置文件中的端口一致
Expand Down
4 changes: 2 additions & 2 deletions docs/en/features/https.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
1.config in eventmesh-runtime

```
proxy.properties(add config as follows)
proxy.server.useTls.enabled=true //default value is false
eventMesh.properties(add config as follows)
eventMesh.server.useTls.enabled=true //default value is false
config env varible
Expand Down
8 changes: 4 additions & 4 deletions docs/en/instructions/eventmesh-runtime-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,10 @@ same with RequestHeader of Heartbeat Msg

| Scene | Client Send | Server Reply | Remark |
| ------------ | ---------------------------- | --------------------------------------- | ---- |
| Heartbeat | HEARTBEAT(203) | SUCCESS(0)/PROXY_HEARTBEAT_ERROR(19) | |
| Subscribe | SUBSCRIBE(206) | SUCCESS(0)/PROXY_SUBSCRIBE_ERROR(17) | |
| Unsubscribe | UNSUBSCRIBE(207) | SUCCESS(0)/PROXY_UNSUBSCRIBE_ERROR(18) | |
| Send async msg | MSG_SEND_ASYNC(104) | SUCCESS(0)/PROXY_SEND_ASYNC_MSG_ERR(14) | |
| Heartbeat | HEARTBEAT(203) | SUCCESS(0)/EVENTMESH_HEARTBEAT_ERROR(19) | |
| Subscribe | SUBSCRIBE(206) | SUCCESS(0)/EVENTMESH_SUBSCRIBE_ERROR(17) | |
| Unsubscribe | UNSUBSCRIBE(207) | SUCCESS(0)/EVENTMESH_UNSUBSCRIBE_ERROR(18) | |
| Send async msg | MSG_SEND_ASYNC(104) | SUCCESS(0)/EVENTMESH_SEND_ASYNC_MSG_ERR(14) | |



Expand Down
22 changes: 11 additions & 11 deletions docs/en/instructions/eventmesh-runtime-quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ You will get **EventMesh_1.2.0.tar.gz** in directory /* YOUR DEPLOY PATH */Event
upload Eventmesh_1.2.0.tar.gz
tar -zxvf Eventmesh_1.2.0.tar.gz
cd conf
config your proxy.properties
config your eventMesh.properties
cd ../bin
sh start.sh
```

If you see "ProxyTCPServer[port=10000] started....", you setup runtime successfully.
If you see "EventMeshTCPServer[port=10000] started....", you setup runtime successfully.



Expand Down Expand Up @@ -106,37 +106,37 @@ execute `docker pull eventmesh/eventmesh-rocketmq:v1.2.0` , you will get EventMe

### 3.2 Config

> **prerequisite** : may be you need download the source code from git first and use the contents of these files(proxy.properties and rocketmq-client.properties) as a reference for the following actions.
> **prerequisite** : may be you need download the source code from git first and use the contents of these files(eventMesh.properties and rocketmq-client.properties) as a reference for the following actions.
**3.2.1 Files to configure**

Before run the container you should configure some files.

**proxy.properties**
**eventMesh.properties**

| Configuration Key | Default Value | Remarks |
| ---------------------- | ------------- | -------------------------- |
| proxy.server.http.port | 10105 | EventMesh http server port |
| proxy.server.tcp.port | 10000 | EventMesh tcp server port |
| eventMesh.server.http.port | 10105 | EventMesh http server port |
| eventMesh.server.tcp.port | 10000 | EventMesh tcp server port |

**rocketmq-client.properties**

| Configuration Key | Default Value | Remarks |
| --------------------------------- | ----------------------------- | -------------------------------- |
| proxy.server.rocketmq.namesrvAddr | 127.0.0.1:9876;127.0.0.1:9876 | RocketMQ namesrv default address |
| eventMesh.server.rocketmq.namesrvAddr | 127.0.0.1:9876;127.0.0.1:9876 | RocketMQ namesrv default address |

After pull the EventMesh image to your host machine, you can execute command below to configure **proxy.properties** and **rocketmq-client.properties**
After pull the EventMesh image to your host machine, you can execute command below to configure **eventMesh.properties** and **rocketmq-client.properties**

**3.2.2 Create Files**

```shell
mkdir -p /data/eventmesh/rocketmq/conf
cd /data/eventmesh/rocketmq/conf
vi proxy.properties
vi eventMesh.properties
vi rocketmq-client.properties
```

The contents of these files can reference from [proxy.properties](https://github.com/WeBankFinTech/EventMesh/blob/develop/eventmesh-runtime/conf/proxy.properties) and [rocketmq-client.properties](https://github.com/WeBankFinTech/EventMesh/blob/develop/eventmesh-runtime/conf/rocketmq-client.properties)
The contents of these files can reference from [eventMesh.properties](https://github.com/WeBankFinTech/EventMesh/blob/develop/eventmesh-runtime/conf/eventMesh.properties) and [rocketmq-client.properties](https://github.com/WeBankFinTech/EventMesh/blob/develop/eventmesh-runtime/conf/rocketmq-client.properties)

### 3.3 Run

Expand All @@ -145,7 +145,7 @@ The contents of these files can reference from [proxy.properties](https://github
execute command below to run container

```
docker run -d -p 10000:10000 -p 10105:10105 -v /data/eventmesh/rocketmq/conf/proxy.properties:/data/app/eventmesh/conf/proxy.properties -v /data/eventmesh/rocketmq/conf/rocketmq-client.properties:/data/app/eventmesh/conf/rocketmq-client.properties docker.io/eventmesh/eventmesh-rocketmq:v1.2.0
docker run -d -p 10000:10000 -p 10105:10105 -v /data/eventmesh/rocketmq/conf/eventMesh.properties:/data/app/eventmesh/conf/eventMesh.properties -v /data/eventmesh/rocketmq/conf/rocketmq-client.properties:/data/app/eventmesh/conf/rocketmq-client.properties docker.io/eventmesh/eventmesh-rocketmq:v1.2.0
```

> -p : binding the container port with host machine port
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class Constants {

public static final String DEFAULT_CHARSET = "UTF-8";

public static final String TARGET_PROXY_REGION = "TARGET_PROXY_REGION";
public static final String TARGET_EVENTMESH_REGION = "TARGET_EVENTMESH_REGION";

public static final String CONSTANTS_DEFAULT_REGION_KEY = "default";

Expand All @@ -35,7 +35,7 @@ public class Constants {

public static final int DEFAULT_HTTP_TIME_OUT = 3000;

public static final String PROXY_MESSAGE_CONST_TTL = "ttl";
public static final String EVENTMESH_MESSAGE_CONST_TTL = "ttl";

public static final Integer DEFAULT_CLIENT_UNACK = 12;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,28 @@

package com.webank.eventmesh.common;

public class ProxyException extends Exception {
public class EventMeshException extends Exception {

public ProxyException() {
public EventMeshException() {
}

public ProxyException(String message) {
public EventMeshException(String message) {
super(message);
}

public ProxyException(String message, Throwable cause) {
public EventMeshException(String message, Throwable cause) {
super(message, cause);
}

public ProxyException(Throwable cause) {
public EventMeshException(Throwable cause) {
super(cause);
}

public ProxyException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
public EventMeshException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}

public ProxyException(Integer errCode, String errMsg) {
public EventMeshException(Integer errCode, String errMsg) {
super((new StringBuilder()).append(errCode)
.append("|")
.append(errMsg).toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
import java.util.Enumeration;

public class CommonConfiguration {
public String proxyEnv = "P";
public String proxyRegion = "";
public String proxyIDC = "FT";
public String proxyDCN = "1C0";
public String proxyCluster = "LS";
public String proxyName = "";
public String eventMeshEnv = "P";
public String eventMeshRegion = "";
public String eventMeshIDC = "FT";
public String eventMeshDCN = "1C0";
public String eventMeshCluster = "LS";
public String eventMeshName = "";
public String sysID = "5477";


Expand All @@ -47,70 +47,70 @@ public class CommonConfiguration {
public Integer pollNameServerInteval = 10 * 1000;
public Integer heartbeatBrokerInterval = 30 * 1000;
public Integer rebalanceInterval = 20 * 1000;
public Integer proxyRegisterIntervalInMills = 10 * 1000;
public Integer proxyFetchRegistryAddrInterval = 10 * 1000;
public String proxyServerIp = null;
public Integer eventMeshRegisterIntervalInMills = 10 * 1000;
public Integer eventMeshFetchRegistryAddrInterval = 10 * 1000;
public String eventMeshServerIp = null;
protected ConfigurationWraper configurationWraper;

public CommonConfiguration(ConfigurationWraper configurationWraper) {
this.configurationWraper = configurationWraper;
}

public void init() {
String proxyEnvStr = configurationWraper.getProp(ConfKeys.KEYS_PROXY_ENV);
Preconditions.checkState(StringUtils.isNotEmpty(proxyEnvStr), String.format("%s error", ConfKeys.KEYS_PROXY_ENV));
proxyEnv = StringUtils.deleteWhitespace(proxyEnvStr);
String eventMeshEnvStr = configurationWraper.getProp(ConfKeys.KEYS_EVENTMESH_ENV);
Preconditions.checkState(StringUtils.isNotEmpty(eventMeshEnvStr), String.format("%s error", ConfKeys.KEYS_EVENTMESH_ENV));
eventMeshEnv = StringUtils.deleteWhitespace(eventMeshEnvStr);

String proxyRegionStr = configurationWraper.getProp(ConfKeys.KEYS_PROXY_REGION);
Preconditions.checkState(StringUtils.isNotEmpty(proxyRegionStr), String.format("%s error", ConfKeys.KEYS_PROXY_REGION));
proxyRegion = StringUtils.deleteWhitespace(proxyRegionStr);
String eventMeshRegionStr = configurationWraper.getProp(ConfKeys.KEYS_EVENTMESH_REGION);
Preconditions.checkState(StringUtils.isNotEmpty(eventMeshRegionStr), String.format("%s error", ConfKeys.KEYS_EVENTMESH_REGION));
eventMeshRegion = StringUtils.deleteWhitespace(eventMeshRegionStr);

String sysIdStr = configurationWraper.getProp(ConfKeys.KEYS_PROXY_SYSID);
Preconditions.checkState(StringUtils.isNotEmpty(sysIdStr) && StringUtils.isNumeric(sysIdStr), String.format("%s error", ConfKeys.KEYS_PROXY_SYSID));
String sysIdStr = configurationWraper.getProp(ConfKeys.KEYS_EVENTMESH_SYSID);
Preconditions.checkState(StringUtils.isNotEmpty(sysIdStr) && StringUtils.isNumeric(sysIdStr), String.format("%s error", ConfKeys.KEYS_EVENTMESH_SYSID));
sysID = StringUtils.deleteWhitespace(sysIdStr);

String proxyClusterStr = configurationWraper.getProp(ConfKeys.KEYS_PROXY_SERVER_CLUSTER);
Preconditions.checkState(StringUtils.isNotEmpty(proxyClusterStr), String.format("%s error", ConfKeys.KEYS_PROXY_SERVER_CLUSTER));
proxyCluster = StringUtils.deleteWhitespace(proxyClusterStr);
String eventMeshClusterStr = configurationWraper.getProp(ConfKeys.KEYS_EVENTMESH_SERVER_CLUSTER);
Preconditions.checkState(StringUtils.isNotEmpty(eventMeshClusterStr), String.format("%s error", ConfKeys.KEYS_EVENTMESH_SERVER_CLUSTER));
eventMeshCluster = StringUtils.deleteWhitespace(eventMeshClusterStr);

String proxyNameStr = configurationWraper.getProp(ConfKeys.KEYS_PROXY_SERVER_NAME);
Preconditions.checkState(StringUtils.isNotEmpty(proxyNameStr), String.format("%s error", ConfKeys.KEYS_PROXY_SERVER_NAME));
proxyName = StringUtils.deleteWhitespace(proxyNameStr);
String eventMeshNameStr = configurationWraper.getProp(ConfKeys.KEYS_EVENTMESH_SERVER_NAME);
Preconditions.checkState(StringUtils.isNotEmpty(eventMeshNameStr), String.format("%s error", ConfKeys.KEYS_EVENTMESH_SERVER_NAME));
eventMeshName = StringUtils.deleteWhitespace(eventMeshNameStr);

String proxyIDCStr = configurationWraper.getProp(ConfKeys.KEYS_PROXY_IDC);
Preconditions.checkState(StringUtils.isNotEmpty(proxyIDCStr), String.format("%s error", ConfKeys.KEYS_PROXY_IDC));
proxyIDC = StringUtils.deleteWhitespace(proxyIDCStr);
String eventMeshIDCStr = configurationWraper.getProp(ConfKeys.KEYS_EVENTMESH_IDC);
Preconditions.checkState(StringUtils.isNotEmpty(eventMeshIDCStr), String.format("%s error", ConfKeys.KEYS_EVENTMESH_IDC));
eventMeshIDC = StringUtils.deleteWhitespace(eventMeshIDCStr);

String proxyDCNStr = configurationWraper.getProp(ConfKeys.KEYS_PROXY_DCN);
Preconditions.checkState(StringUtils.isNotEmpty(proxyDCNStr), String.format("%s error", ConfKeys.KEYS_PROXY_DCN));
proxyDCN = StringUtils.deleteWhitespace(proxyDCNStr);
String eventMeshDCNStr = configurationWraper.getProp(ConfKeys.KEYS_EVENTMESH_DCN);
Preconditions.checkState(StringUtils.isNotEmpty(eventMeshDCNStr), String.format("%s error", ConfKeys.KEYS_EVENTMESH_DCN));
eventMeshDCN = StringUtils.deleteWhitespace(eventMeshDCNStr);

proxyServerIp = configurationWraper.getProp(ConfKeys.KEYS_PROXY_SERVER_HOST_IP);
if(StringUtils.isBlank(proxyServerIp)) {
proxyServerIp = getLocalAddr();
eventMeshServerIp = configurationWraper.getProp(ConfKeys.KEYS_EVENTMESH_SERVER_HOST_IP);
if(StringUtils.isBlank(eventMeshServerIp)) {
eventMeshServerIp = getLocalAddr();
}
}

static class ConfKeys {
public static String KEYS_PROXY_ENV = "proxy.server.env";
public static String KEYS_EVENTMESH_ENV = "eventMesh.server.env";

public static String KEYS_PROXY_REGION = "proxy.server.region";
public static String KEYS_EVENTMESH_REGION = "eventMesh.server.region";

public static String KEYS_PROXY_IDC = "proxy.server.idc";
public static String KEYS_EVENTMESH_IDC = "eventMesh.server.idc";

public static String KEYS_PROXY_DCN = "proxy.server.dcn";
public static String KEYS_EVENTMESH_DCN = "eventMesh.server.dcn";

public static String KEYS_PROXY_SYSID = "proxy.sysid";
public static String KEYS_EVENTMESH_SYSID = "eventMesh.sysid";

public static String KEYS_PROXY_SERVER_CLUSTER = "proxy.server.cluster";
public static String KEYS_EVENTMESH_SERVER_CLUSTER = "eventMesh.server.cluster";

public static String KEYS_PROXY_SERVER_NAME = "proxy.server.name";
public static String KEYS_EVENTMESH_SERVER_NAME = "eventMesh.server.name";

public static String KEYS_PROXY_SERVER_HOST_IP = "proxy.server.hostIp";
public static String KEYS_EVENTMESH_SERVER_HOST_IP = "eventMesh.server.hostIp";

public static String KEYS_PROXY_SERVER_REGISTER_INTERVAL = "proxy.server.registry.registerIntervalInMills";
public static String KEYS_EVENTMESH_SERVER_REGISTER_INTERVAL = "eventMesh.server.registry.registerIntervalInMills";

public static String KEYS_PROXY_SERVER_FETCH_REGISTRY_ADDR_INTERVAL = "proxy.server.registry.fetchRegistryAddrIntervalInMills";
public static String KEYS_EVENTMESH_SERVER_FETCH_REGISTRY_ADDR_INTERVAL = "eventMesh.server.registry.fetchRegistryAddrIntervalInMills";
}

public static String getLocalAddr() {
Expand Down
Loading

0 comments on commit 67847fe

Please sign in to comment.