Skip to content

Commit 5e2749b

Browse files
authored
Merge branch 'apache:master' into master
2 parents 5dbf4fc + 52a1bb1 commit 5e2749b

File tree

130 files changed

+15409
-4629
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+15409
-4629
lines changed

README.md

+4-9
Original file line numberDiff line numberDiff line change
@@ -180,26 +180,21 @@ eventmesh-runtime-0-a-0 1/1 Running 0 15s
180180

181181
## Contributing
182182

183+
[![GitHub repo Good Issues for newbies](https://img.shields.io/github/issues/apache/eventmesh/good%20first%20issue?style=flat&logo=github&logoColor=green&label=Good%20First%20issues)](https://github.com/apache/eventmesh/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) [![GitHub Help Wanted issues](https://img.shields.io/github/issues/apache/eventmesh/help%20wanted?style=flat&logo=github&logoColor=b545d1&label=%22Help%20Wanted%22%20issues)](https://github.com/apache/eventmesh/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) [![GitHub Help Wanted PRs](https://img.shields.io/github/issues-pr/apache/eventmesh/help%20wanted?style=flat&logo=github&logoColor=b545d1&label=%22Help%20Wanted%22%20PRs)](https://github.com/apache/eventmesh/pulls?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) [![GitHub repo Issues](https://img.shields.io/github/issues/apache/eventmesh?style=flat&logo=github&logoColor=red&label=Issues)](https://github.com/apache/eventmesh/issues?q=is%3Aopen)
184+
183185
Each contributor has played an important role in promoting the robust development of Apache EventMesh. We sincerely appreciate all contributors who have contributed code and documents.
184186

185187
- [Contributing Guideline](https://eventmesh.apache.org/community/contribute/contribute)
186188
- [Good First Issues](https://github.com/apache/eventmesh/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)
187189

188-
Here is the [List of Contributors](https://github.com/apache/eventmesh/graphs/contributors), thank you all! :)
189-
190-
<a href="https://github.com/apache/eventmesh/graphs/contributors">
191-
<img src="https://contrib.rocks/image?repo=apache/eventmesh&max=2000" />
192-
</a>
193-
194190

195191
## CNCF Landscape
196192

197193
<div align="center">
198194

199-
<img src="https://landscape.cncf.io/images/left-logo.svg" width="150"/>
200-
<img src="https://landscape.cncf.io/images/right-logo.svg" width="200"/>
195+
<img src="https://landscape.cncf.io/images/cncf-landscape-horizontal-color.svg" width="200"/>
201196

202-
Apache EventMesh enriches the <a href="https://landscape.cncf.io/serverless?license=apache-license-2-0">CNCF Cloud Native Landscape.</a>
197+
Apache EventMesh enriches the <a href="https://landscape.cncf.io/embed/embed.html?base-path=&key=serverless--framework&headers=true&category-header=true&category-in-subcategory=false&title-uppercase=false&title-alignment=left&title-font-family=sans-serif&title-font-size=13&style=shadowed&bg-color=%233e79b0&fg-color=%23ffffff&item-modal=false&item-name=false&size=md&items-alignment=left" style="width:100%;height:100%;display:block;border:none;">CNCF Cloud Native Landscape.</a>
203198

204199
</div>
205200

build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ buildscript {
4646
classpath "com.diffplug.spotless:spotless-plugin-gradle:6.13.0"
4747

4848
classpath "org.apache.httpcomponents:httpclient:4.5.14"
49-
classpath "commons-io:commons-io:2.17.0"
49+
classpath "commons-io:commons-io:2.18.0"
5050
}
5151
}
5252

@@ -711,7 +711,7 @@ subprojects {
711711
dependency "org.apache.commons:commons-lang3:3.17.0"
712712
dependency "org.apache.commons:commons-collections4:4.4"
713713
dependency "org.apache.commons:commons-text:1.12.0"
714-
dependency "commons-io:commons-io:2.17.0"
714+
dependency "commons-io:commons-io:2.18.0"
715715
dependency "commons-validator:commons-validator:1.9.0"
716716
dependency "com.google.guava:guava:33.3.0-jre"
717717

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
#!/bin/bash
2+
#
3+
# Licensed to Apache Software Foundation (ASF) under one or more contributor
4+
# license agreements. See the NOTICE file distributed with
5+
# this work for additional information regarding copyright
6+
# ownership. Apache Software Foundation (ASF) licenses this file to you under
7+
# the Apache License, Version 2.0 (the "License"); you may
8+
# not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
15+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
# KIND, either express or implied. See the License for the
17+
# specific language governing permissions and limitations
18+
# under the License.
19+
20+
# Detect operating system
21+
OS=$(uname)
22+
23+
EVENTMESH_ADMIN_HOME=`cd $(dirname $0)/.. && pwd`
24+
25+
export EVENTMESH_ADMIN_HOME
26+
27+
function get_pid {
28+
local ppid=""
29+
if [ -f ${EVENTMESH_ADMIN_HOME}/bin/pid-admin.file ]; then
30+
ppid=$(cat ${EVENTMESH_ADMIN_HOME}/bin/pid-admin.file)
31+
# If the process does not exist, it indicates that the previous process terminated abnormally.
32+
if [ ! -d /proc/$ppid ]; then
33+
# Remove the residual file and return an error status.
34+
rm ${EVENTMESH_ADMIN_HOME}/bin/pid-admin.file
35+
echo -e "ERROR\t EventMesh admin process had already terminated unexpectedly before, please check log output."
36+
ppid=""
37+
fi
38+
else
39+
if [[ $OS =~ Msys ]]; then
40+
# There is a Bug on Msys that may not be able to kill the identified process
41+
ppid=`jps -v | grep -i "org.apache.eventmesh.admin.server.ExampleAdminServer" | grep java | grep -v grep | awk -F ' ' {'print $1'}`
42+
elif [[ $OS =~ Darwin ]]; then
43+
# Known problem: grep Java may not be able to accurately identify Java processes
44+
ppid=$(/bin/ps -o user,pid,command | grep "java" | grep -i "org.apache.eventmesh.admin.server.ExampleAdminServer" | grep -Ev "^root" |awk -F ' ' {'print $2'})
45+
else
46+
# It is required to identify the process as accurately as possible on Linux
47+
ppid=$(ps -C java -o user,pid,command --cols 99999 | grep -w $EVENTMESH_ADMIN_HOME | grep -i "org.apache.eventmesh.admin.server.ExampleAdminServer" | grep -Ev "^root" |awk -F ' ' {'print $2'})
48+
fi
49+
fi
50+
echo "$ppid";
51+
}
52+
53+
pid=$(get_pid)
54+
if [[ $pid == "ERROR"* ]]; then
55+
echo -e "${pid}"
56+
exit 9
57+
fi
58+
if [ -z "$pid" ];then
59+
echo -e "ERROR\t No EventMesh admin server running."
60+
exit 9
61+
fi
62+
63+
kill ${pid}
64+
echo "Send shutdown request to EventMesh admin(${pid}) OK"
65+
66+
[[ $OS =~ Msys ]] && PS_PARAM=" -W "
67+
stop_timeout=60
68+
for no in $(seq 1 $stop_timeout); do
69+
if ps $PS_PARAM -p "$pid" 2>&1 > /dev/null; then
70+
if [ $no -lt $stop_timeout ]; then
71+
echo "[$no] server shutting down ..."
72+
sleep 1
73+
continue
74+
fi
75+
76+
echo "shutdown server timeout, kill process: $pid"
77+
kill -9 $pid; sleep 1; break;
78+
echo "`date +'%Y-%m-%-d %H:%M:%S'` , pid : [$pid] , error message : abnormal shutdown which can not be closed within 60s" > ../logs/shutdown.error
79+
else
80+
echo "shutdown server ok!"; break;
81+
fi
82+
done
83+
84+
if [ -f "pid-admin.file" ]; then
85+
rm pid-admin.file
86+
fi
87+
88+

eventmesh-admin-server/conf/application.yaml

+20-4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,24 @@ spring:
2121
username: //db_username
2222
password: //db_password
2323
driver-class-name: com.mysql.cj.jdbc.Driver
24+
initialSize: 1
25+
minIdle: 1
26+
maxActive: 20
27+
maxWait: 10000
28+
timeBetweenEvictionRunsMillis: 60000
29+
minEvictableIdleTimeMillis: 300000
30+
validationQuery: SELECT 1 FROM DUAL
31+
testWhileIdle: true
32+
testOnBorrow: false
33+
testOnReturn: false
34+
poolPreparedStatements: false
35+
maxPoolPreparedStatementPerConnectionSize: 20
36+
filters: stat
37+
connectionProperties: "druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000"
38+
# secret keys
39+
sysPubKey:
40+
appPrivKey:
41+
2442
mybatis-plus:
2543
mapper-locations: classpath:mapper/*.xml
2644
configuration:
@@ -35,8 +53,6 @@ event-mesh:
3553
# grpc server port
3654
port: 8081
3755
adminServerList:
38-
R1:
39-
- http://localhost:8082
40-
R2:
41-
- http://localhost:8082
56+
R1: http://localhost:8082;http://localhost:8082
57+
R2: http://localhost:8092;http://localhost:8092
4258
region: R1

eventmesh-admin-server/conf/eventmesh-admin.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
# limitations under the License.
1616
#
1717

18-
eventMesh.server.retry.plugin.type=nacos
18+
eventMesh.registry.plugin.type=nacos
1919
eventMesh.registry.plugin.server-addr=localhost:8848

eventmesh-admin-server/conf/eventmesh.sql

+33
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,39 @@ CREATE TABLE IF NOT EXISTS `event_mesh_verify` (
146146
PRIMARY KEY (`id`)
147147
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
148148

149+
-- eventmesh.event_mesh_weredis_position definition
150+
CREATE TABLE `event_mesh_weredis_position` (
151+
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
152+
`jobID` varchar(50) COLLATE utf8_bin NOT NULL DEFAULT '',
153+
`address` varchar(50) COLLATE utf8_bin DEFAULT NULL,
154+
`clusterName` varchar(50) COLLATE utf8_bin DEFAULT NULL,
155+
`partitionName` varchar(50) COLLATE utf8_bin DEFAULT NULL,
156+
`masterReplid` varchar(50) COLLATE utf8_bin DEFAULT NULL,
157+
`host` varchar(50) COLLATE utf8_bin DEFAULT NULL,
158+
`replOffset` bigint(20) NOT NULL DEFAULT '-1',
159+
`createTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
160+
`updateTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
161+
PRIMARY KEY (`id`),
162+
UNIQUE KEY `jobID` (`jobID`)
163+
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_bin ROW_FORMAT=DYNAMIC;
164+
165+
166+
CREATE TABLE `event_mesh_monitor` (
167+
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
168+
`taskID` varchar(50) COLLATE utf8_bin DEFAULT NULL,
169+
`jobID` varchar(50) COLLATE utf8_bin DEFAULT NULL,
170+
`address` varchar(50) COLLATE utf8_bin DEFAULT NULL,
171+
`transportType` varchar(50) COLLATE utf8_bin DEFAULT NULL,
172+
`connectorStage` varchar(50) COLLATE utf8_bin DEFAULT NULL,
173+
`totalReqNum` bigint DEFAULT NULL,
174+
`totalTimeCost` bigint DEFAULT NULL,
175+
`maxTimeCost` bigint DEFAULT NULL,
176+
`avgTimeCost` bigint DEFAULT NULL,
177+
`tps` double DEFAULT NULL,
178+
`createTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
179+
PRIMARY KEY (`id`)
180+
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
181+
149182
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
150183
/*!40014 SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS, 1) */;
151184
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;

eventmesh-admin-server/conf/log4j2.xml

-68
Original file line numberDiff line numberDiff line change
@@ -28,74 +28,6 @@
2828
<AppenderRef ref="console"/>
2929
</AsyncRoot>
3030

31-
<AsyncLogger name="retry" level="info" additivity="false" includeLocation="true">
32-
<AppenderRef ref="retryAppender"/>
33-
</AsyncLogger>
34-
35-
<AsyncLogger name="httpMonitor" level="debug" additivity="false" includeLocation="true">
36-
<AppenderRef ref="console"/>
37-
</AsyncLogger>
38-
39-
<AsyncLogger name="tcpMonitor" level="debug" additivity="false" includeLocation="true">
40-
<AppenderRef ref="console"/>
41-
</AsyncLogger>
42-
43-
<AsyncLogger name="appMonitor" level="debug" additivity="false" includeLocation="true">
44-
<AppenderRef ref="console"/>
45-
</AsyncLogger>
46-
47-
<AsyncLogger name="cmd" level="debug" additivity="false" includeLocation="true">
48-
<AppenderRef ref="console"/>
49-
</AsyncLogger>
50-
51-
<AsyncLogger name="message" level="debug" additivity="false" includeLocation="true">
52-
<AppenderRef ref="console"/>
53-
</AsyncLogger>
54-
55-
<AsyncLogger name="batchMessage" level="debug" additivity="false" includeLocation="true">
56-
<AppenderRef ref="console"/>
57-
</AsyncLogger>
58-
59-
<AsyncLogger name="http" level="debug" additivity="false" includeLocation="true">
60-
<AppenderRef ref="console"/>
61-
</AsyncLogger>
62-
63-
<AsyncLogger name="metaStorage" level="debug" additivity="false" includeLocation="true">
64-
<AppenderRef ref="console"/>
65-
</AsyncLogger>
66-
67-
<AsyncLogger name="acl" level="debug" additivity="false" includeLocation="true">
68-
<AppenderRef ref="console"/>
69-
</AsyncLogger>
70-
71-
<AsyncLogger name="org.apache.eventmesh.runtime" level="debug" additivity="false" includeLocation="true">
72-
<AppenderRef ref="console"/>
73-
</AsyncLogger>
74-
75-
<AsyncLogger name="org.apache.rocketmq" level="INFO" additivity="false" includeLocation="true">
76-
<AppenderRef ref="console"/>
77-
</AsyncLogger>
78-
79-
<AsyncLogger name="RocketmqClient" level="INFO" additivity="false" includeLocation="true">
80-
<AppenderRef ref="console"/>
81-
</AsyncLogger>
82-
83-
<AsyncLogger name="RocketmqRemoting" level="INFO" additivity="false" includeLocation="true">
84-
<AppenderRef ref="console"/>
85-
</AsyncLogger>
86-
87-
<AsyncLogger name="RocketmqCommon" level="debug" additivity="false" includeLocation="true">
88-
<AppenderRef ref="console"/>
89-
</AsyncLogger>
90-
91-
<AsyncLogger name="sessionLogger" level="debug" additivity="false" includeLocation="true">
92-
<AppenderRef ref="console"/>
93-
</AsyncLogger>
94-
95-
<AsyncLogger name="subscribeLogger" level="info" additivity="false" includeLocation="true">
96-
<AppenderRef ref="console"/>
97-
</AsyncLogger>
98-
9931
<AsyncLogger name="com.alipay.sofa.jraft" level="info" additivity="false" includeLocation="true">
10032
<AppenderRef ref="console"/>
10133
</AsyncLogger>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<!--
4+
* Licensed to the Apache Software Foundation (ASF) under one or more
5+
* contributor license agreements. See the NOTICE file distributed with
6+
* this work for additional information regarding copyright ownership.
7+
* The ASF licenses this file to You under the Apache License, Version 2.0
8+
* (the "License"); you may not use this file except in compliance with
9+
* the License. You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
19+
-->
20+
21+
<!DOCTYPE mapper
22+
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
23+
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
24+
<mapper namespace="org.apache.eventmesh.admin.server.web.db.mapper.EventMeshMonitorMapper">
25+
26+
<resultMap id="BaseResultMap" type="org.apache.eventmesh.admin.server.web.db.entity.EventMeshMonitor">
27+
<id property="id" column="id" jdbcType="INTEGER"/>
28+
<result property="taskID" column="taskID" jdbcType="VARCHAR"/>
29+
<result property="jobID" column="jobID" jdbcType="VARCHAR"/>
30+
<result property="address" column="address" jdbcType="VARCHAR"/>
31+
<result property="transportType" column="transportType" jdbcType="VARCHAR"/>
32+
<result property="connectorStage" column="connectorStage" jdbcType="VARCHAR"/>
33+
<result property="totalReqNum" column="totalReqNum" jdbcType="BIGINT"/>
34+
<result property="totalTimeCost" column="totalTimeCost" jdbcType="BIGINT"/>
35+
<result property="maxTimeCost" column="maxTimeCost" jdbcType="BIGINT"/>
36+
<result property="avgTimeCost" column="avgTimeCost" jdbcType="BIGINT"/>
37+
<result property="tps" column="tps" jdbcType="DOUBLE"/>
38+
<result property="createTime" column="createTime" jdbcType="TIMESTAMP"/>
39+
</resultMap>
40+
41+
<sql id="Base_Column_List">
42+
id,taskID,jobID,address,transportType,connectorStage,
43+
totalReqNum,totalTimeCost,maxTimeCost,avgTimeCost,
44+
tps,createTime
45+
</sql>
46+
</mapper>

eventmesh-admin-server/src/main/java/org/apache/eventmesh/admin/server/AdminServerProperties.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
package org.apache.eventmesh.admin.server;
1919

20-
import java.util.List;
2120
import java.util.Map;
2221

2322
import org.springframework.boot.context.properties.ConfigurationProperties;
@@ -35,6 +34,6 @@ public class AdminServerProperties {
3534
private String configurationPath;
3635
private String configurationFile;
3736
private String serviceName;
38-
private Map<String, List<String>> adminServerList;
37+
private Map<String, String> adminServerList;
3938
private String region;
4039
}

eventmesh-admin-server/src/main/java/org/apache/eventmesh/admin/server/ExampleAdminServer.java

+7-2
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,22 @@
1717

1818
package org.apache.eventmesh.admin.server;
1919

20-
import org.apache.eventmesh.admin.server.constatns.AdminServerConstants;
20+
import org.apache.eventmesh.admin.server.constants.AdminServerConstants;
2121
import org.apache.eventmesh.common.config.ConfigService;
2222

2323
import org.springframework.boot.SpringApplication;
2424
import org.springframework.boot.autoconfigure.SpringBootApplication;
25+
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
2526

26-
@SpringBootApplication(scanBasePackages = "org.apache.eventmesh.admin.server")
27+
import lombok.extern.slf4j.Slf4j;
28+
29+
@Slf4j
30+
@SpringBootApplication(scanBasePackages = "org.apache.eventmesh.admin.server", exclude = {DataSourceAutoConfiguration.class})
2731
public class ExampleAdminServer {
2832

2933
public static void main(String[] args) throws Exception {
3034
ConfigService.getInstance().setConfigPath(AdminServerConstants.EVENTMESH_CONF_HOME).setRootConfig(AdminServerConstants.EVENTMESH_CONF_FILE);
3135
SpringApplication.run(ExampleAdminServer.class);
36+
log.info("admin start success.");
3237
}
3338
}

eventmesh-admin-server/src/main/java/org/apache/eventmesh/admin/server/constatns/AdminServerConstants.java eventmesh-admin-server/src/main/java/org/apache/eventmesh/admin/server/constants/AdminServerConstants.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18-
package org.apache.eventmesh.admin.server.constatns;
18+
package org.apache.eventmesh.admin.server.constants;
1919

2020
public class AdminServerConstants {
2121
public static final String CONF_ENV = "configurationPath";

0 commit comments

Comments
 (0)