You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eventmesh.apache.org by mi...@apache.org on 2021/12/08 17:20:52 UTC
[incubator-eventmesh] branch cloudevents updated: fix conflicts and update the code (#635)
This is an automated email from the ASF dual-hosted git repository.
mikexue pushed a commit to branch cloudevents
in repository https://gitbox.apache.org/repos/asf/incubator-eventmesh.git
The following commit(s) were added to refs/heads/cloudevents by this push:
new 8ea15f6 fix conflicts and update the code (#635)
8ea15f6 is described below
commit 8ea15f650e2a4587a1d3178a3f2b348ba3736f05
Author: mike_xwm <mi...@126.com>
AuthorDate: Thu Dec 9 01:20:45 2021 +0800
fix conflicts and update the code (#635)
* Add files via upload
* Update README.md
* [ISSUE #580] Add checkstyle gradle plugin (#581)
* Add checkstyle gradle plugin, change plugin package
* skip check in ci
* update wechat-official qr code
* update mesh-helper qr code
* Add files via upload
* update README.md
* update README.md
* Update .asf.yaml
* [ISSUE #588] Fix typo in README.md (#589)
close #588
* [Bug #590] Consumer subscription topic is invalid (#590) (#592)
* [Bug #590] Consumer subscription topic is invalid (#590)
* [Bug #590] Consumer subscription topic is invalid (#590)
close #590
* fixed a wrong url in cn-doc (#585)
close #596
* resolve_exception->Consumer subscription topic is invalid #590 (#598)
close #590
* Update eventmesh-store-quickstart.md
* Update README.md
* Add slack icon (#601)
* eventmesh-admin-rocketmq submodule and createTopic REST API (#530)
* eventmesh-admin-rocketmq submodule and createTopic draft API
* add license header
* change to /topicmanage
* fix build error
* fix some code check style issues
close #435 #346
* create topic command (#531)
* create topic command
* address review comments
* fix build and add createtopic method to standalone module
* fix build issue
* fix a few remaining code check issues
* fix test
close #346
* Update README.md
* Safely delete useless log4j dependencies
* Safely delete outdated metrics dependencies
* Sately delete useless collections4 dependency
* Safely delete useless commons dependencies
* Reback to the collections4, but let it not in api dependency
* Could not remove text for Safe Ramdom implementation
* Fix build error
* Add collection4
* Fix build error
* Revert "Safely delete outdated metrics dependencies"
This reverts commit 92287b0fd15084be9df6ce68c5c5b16e2f33f4c0.
* Change to api dependency
* Remove doclint warnings
* Depracated checkstyle check error temporarily, we should remove it when we polish later
* Update .asf.yaml
* Update .asf.yaml
Co-authored-by: Eason Chen <qq...@gmail.com>
Co-authored-by: Wenjun Ruan <we...@apache.org>
Co-authored-by: Nicholas Zhan <zh...@outlook.com>
Co-authored-by: hagsyn <44...@users.noreply.github.com>
Co-authored-by: sarihuangshanrong <28...@qq.com>
Co-authored-by: yuri <yu...@huawei.com>
Co-authored-by: vongosling <vo...@apache.org>
---
.asf.yaml | 2 +-
README.md | 19 ++--
README.zh-CN.md | 2 +-
build.gradle | 17 +++-
docs/en/instructions/eventmesh-store-quickstart.md | 52 +++-------
eventmesh-admin/README.md | 12 +--
eventmesh-admin/build.gradle | 19 +++-
.../eventmesh-admin-rocketmq}/build.gradle | 19 +---
.../eventmesh-admin-rocketmq/gradle.properties | 5 +-
.../rocketmq/controller/AdminController.java} | 27 ++++-
.../admin/rocketmq/handler/TopicsHandler.java | 108 ++++++++++++++++++++
.../rocketmq/request/TopicCreateRequest.java} | 32 +++++-
.../admin/rocketmq/response/TopicResponse.java | 64 ++++++++++++
.../eventmesh/admin/rocketmq/util/JsonUtils.java | 72 ++++++++++++++
.../eventmesh/admin/rocketmq/util/NetUtils.java | 51 ++++++++++
.../admin/rocketmq/util/RequestMapping.java | 60 ++++++++++++
.../admin/rocketmq/util/UrlMappingPattern.java | 109 +++++++++++++++++++++
eventmesh-common/build.gradle | 29 ++++--
.../connector/rocketmq/admin/command/Command.java | 60 ++++++++++++
.../rocketmq/admin/command/CreateTopicCommand.java | 84 ++++++++++++++++
.../rocketmq/config/ClientConfiguration.java | 34 ++++++-
.../src/main/resources/rocketmq-client.properties | 3 +
.../producer/DefaultProducerImplTest.java | 63 ++++++++++++
.../producer/StandaloneMeshMQProducerAdaptor.java | 0
eventmesh-runtime/build.gradle | 17 ++++
.../admin/controller/ClientManageController.java | 25 ++++-
.../http/processor/SubscribeProcessor.java | 65 ++++++------
eventmesh-sdk-java/build.gradle | 10 ++
eventmesh-spi/build.gradle | 2 +
gradle.properties | 2 +
settings.gradle | 2 +-
style/checkStyle.xml | 23 +++--
32 files changed, 950 insertions(+), 139 deletions(-)
diff --git a/.asf.yaml b/.asf.yaml
index 66dc6d7..63fe643 100644
--- a/.asf.yaml
+++ b/.asf.yaml
@@ -37,8 +37,8 @@ github:
- microservice
- state-management
enabled_merge_buttons:
+ merge: true
squash: true
- merge: false
rebase: false
protected_branches:
master:
diff --git a/README.md b/README.md
index cce12ce..9e27b02 100644
--- a/README.md
+++ b/README.md
@@ -5,6 +5,7 @@
[](https://lgtm.com/projects/g/apache/incubator-eventmesh/alerts/)
[](https://github.com/apache/incubator-eventmesh/releases)
[](https://www.apache.org/licenses/LICENSE-2.0.html)
+[](https://join.slack.com/t/apacheeventmesh/shared_invite/zt-yx3n2ak7-HcVG98CDqb~7PwgoDzgfMA)
[点我查看中文版](README.zh-CN.md)
@@ -47,7 +48,7 @@ Event & Service
- [ ] Event transaction
- [ ] At-least-once/at-most-once delivery guarantees
-Connector
+Store Connector
- [x] RocketMQ
- [x] InMemory
- [ ] Federated
@@ -64,6 +65,8 @@ Protocol
- [ ] gRPC
- [ ] CloudEvents
- [ ] MQTT
+- [ ] WebSocket
+- [ ] AMQP
- [ ] AsyncAPI
SDK
@@ -90,7 +93,7 @@ Governance
- [x] Client management
- [ ] Topic management
- [ ] Metadata registry
-- [x] Schema registry
+- [ ] Schema registry
- [ ] Dynamic config
Choreography
@@ -105,7 +108,7 @@ Runtime
- [ ] WebAssembly runtime
## Quick Start
-1. [Connector quickstart](https://rocketmq.apache.org/docs/quick-start/) (RocketMQ, ignore this step if use standalone).
+1. [Store quickstart](docs/en/instructions/eventmesh-store-quickstart.md)
2. [Runtime quickstart](docs/en/instructions/eventmesh-runtime-quickstart.md) or [Runtime quickstart with docker](docs/en/instructions/eventmesh-runtime-quickstart-with-docker.md).
3. [Java SDK examples](docs/en/instructions/eventmesh-sdk-java-quickstart.md).
@@ -127,13 +130,9 @@ EventMesh enriches the <a href="https://landscape.cncf.io/serverless?license=apa
[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html) Copyright (C) Apache Software Foundation.
## Community
-| WeChat group | WeChat public account |
-| :---------------------------------------: | :----------------------------------------------------: |
-|  |  |
-
-
-
-
+| WeChat Assistant | WeChat public account | Slack |
+| :----------------------------------------------------: | :----------------------------------------------------: | :----------------------------------------------------: |
+|  |  |[Join slack chat](https://join.slack.com/t/apacheeventmesh/shared_invite/zt-yx3n2ak7-HcVG98CDqb~7PwgoDzgfMA) |
Mailing Lists:
diff --git a/README.zh-CN.md b/README.zh-CN.md
index bea441b..08ebe7c 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -36,7 +36,7 @@ EventMesh是一个动态的云原生事件驱动架构基础设施,用于分
**通信协议:**
-eventmesh的通信协议更加简洁方便,详细内容,阅读更多[这里](docs/cn/instructions/eventmesh-runtime-protocol.zh-CN.md)
+eventmesh的通信协议更加简洁方便,详细内容,阅读更多[这里](docs/cn/instructions/eventmesh-runtime-protocol.md)
## RoadMap
| version | feature |
diff --git a/build.gradle b/build.gradle
index 260c26b..19d8f96 100644
--- a/build.gradle
+++ b/build.gradle
@@ -35,6 +35,15 @@ buildscript {
}
}
+//Remove doclint warnings that pollute javadoc logs when building with java8
+if(JavaVersion.current().isJava8Compatible()){
+ allprojects {
+ tasks.withType(Javadoc){
+ options.addStringOption('xdoclint:none','-quiet')
+ }
+ }
+}
+
allprojects {
apply plugin: 'java'
apply plugin: "eclipse"
@@ -60,7 +69,7 @@ allprojects {
delete 'out'
}
- if ((project.findProperty("snapshot") instanceof String) && (Boolean.valueOf(project.property("snapshot")))) {
+ if ((project.findProperty("snapshot") instanceof String) && (Boolean.valueOf(project.property("snapshot") as boolean))) {
version = version + "-SNAPSHOT"
}
@@ -400,17 +409,15 @@ subprojects {
dependencies {
dependency "org.apache.commons:commons-lang3:3.6"
dependency "org.apache.commons:commons-collections4:4.1"
- dependency "commons-io:commons-io:2.4"
dependency "org.apache.commons:commons-text:1.9"
- dependency "com.google.guava:guava:29.0-jre"
+ dependency "com.google.guava:guava:29.0-jre"
+
dependency "org.slf4j:slf4j-api:1.7.30"
dependency "org.apache.logging.log4j:log4j-api:2.13.3"
dependency "org.apache.logging.log4j:log4j-core:2.13.3"
- dependency "org.apache.logging.log4j:log4j-core:2.13.3"
dependency "org.apache.logging.log4j:log4j-slf4j-impl:2.13.3"
- dependency "org.apache.logging.log4j:log4j-web:2.13.3"
dependency "com.lmax:disruptor:3.4.2"
diff --git a/docs/en/instructions/eventmesh-store-quickstart.md b/docs/en/instructions/eventmesh-store-quickstart.md
index 74158e8..2c0df05 100644
--- a/docs/en/instructions/eventmesh-store-quickstart.md
+++ b/docs/en/instructions/eventmesh-store-quickstart.md
@@ -8,49 +8,19 @@
Gradle at least 5.6, eg 5.6.*
4g+ free disk for eventmesh-store server
```
+### Standalone-connector
+No need a third-party store.
-### download sources
+### RocketMQ-connector
+you can reference https://rocketmq.apache.org/docs/quick-start/
-download source code from [https://github.com/WeBankFinTech/DeFiBus](https://github.com/WeBankFinTech/DeFiBus)
-You will get **DefiBus-master.zip**
+and "One-click" build script is on going.
-### build sources
+### Kafka-connector
+WIP
-The eventmesh-store takes DeFiBus for example at the following parts, because eventmesh depends on defibus as store layer
-by default, other implements such as Rocketmq etc. is coming soon.
-
-```
-unzip DefiBus-master.zip
-cd /*YOUR DEPLOY PATH*/DefiBus-master
-gradle clean dist tar -x test
-```
-
-You will get **DeFiBus_1.0.0.tar.gz** in directory /* YOUR DEPLOY PATH */DefiBus-master/build
-
-### Deployment
-
-- deploy DeFiBusNamesrv
-
-```
-upload DeFiBus_1.0.0.tar.gz
-tar -zxvf DeFiBus_1.0.0.tar.gz
-cd bin
-sh runnamesrv.sh
-```
-
-If you see "Thre Name Server boot success" in ../logs/namesrv.log, you setup DeFiBus Namesrv successfully.
-
-- deploy DeFiBusBroker
-
-```
-upload DeFiBus_1.0.0.tar.gz
-tar -zxvf DeFiBus_1.0.0.tar.gz
-cd conf
-config your broker.properties
-cd ../bin
-sh runbroker.sh
-```
-
-If you see "The broker \[YOUR-BROKER-NAME, IP:PORT\] boot success." in ../logs/broker.log, you setup eventmesh-store
-successfully.
+### Redis-connector
+WIP
+### DeFiBus-connector
+WIP
diff --git a/eventmesh-admin/README.md b/eventmesh-admin/README.md
index 84f8047..f97d2a9 100644
--- a/eventmesh-admin/README.md
+++ b/eventmesh-admin/README.md
@@ -4,10 +4,10 @@ EventMesh Administration Module for EventMesh. It manages Admin Service, Configu
## Administration Client Manager APIs
-### POST /clientmanage/topics/
+### POST /topicmanage
- Create a new topic if does not exist
- Exposed POST endpoint to create a new topic if it does not exist.
- * Url - http://localhost:8081/clientmanage/topics/
+ * Url - http://localhost:8081/topicmanage
* sample request payload
```json
{
@@ -23,12 +23,12 @@ EventMesh Administration Module for EventMesh. It manages Admin Service, Configu
"created_time": "2021-09-03",
}
```
-### DELETE /clientmanage/topics/(string: topic)/
+### DELETE /topicmanage/(string: topic)
- Delete a specific topic.
- Exposed DELETE endpoint to remove a specific topic
* URL -
```url
- http://localhost:8081/clientmanage/topics/mytopic1
+ http://localhost:8081/topicmanage/mytopic1
```
* Response -
@@ -39,12 +39,12 @@ EventMesh Administration Module for EventMesh. It manages Admin Service, Configu
}
```
-### GET /clientmanage/topics
+### GET /topicmanage
- Retrieve a list of topics
- Exposed GET endpoint to retrieve all topics
* URL -
```url
- http://localhost:8081/clientmanage/topics
+ http://localhost:8081/topicmanage
```
* Response
diff --git a/eventmesh-admin/build.gradle b/eventmesh-admin/build.gradle
index 2bbbee2..0741bc6 100644
--- a/eventmesh-admin/build.gradle
+++ b/eventmesh-admin/build.gradle
@@ -15,5 +15,22 @@
* limitations under the License.
*/
-dependencies {
+task copyEventMeshAdmin(dependsOn: ['jar']) {
+ doFirst {
+ new File(projectDir, '../eventmesh-admin/dist/apps').mkdir()
+ new File(projectDir, '../dist/admin/').mkdirs()
+ }
+ doLast {
+ copy {
+ into('../eventmesh-admin/dist/apps/')
+ from project.jar.getArchivePath()
+ exclude {
+ "eventmesh-admin-${version}.jar"
+ }
+ }
+ copy {
+ into '../dist/admin'
+ from "../eventmesh-admin/dist/apps/eventmesh-admin-rocketmq-${version}.jar"
+ }
+ }
}
\ No newline at end of file
diff --git a/eventmesh-sdk-java/build.gradle b/eventmesh-admin/eventmesh-admin-rocketmq/build.gradle
similarity index 68%
copy from eventmesh-sdk-java/build.gradle
copy to eventmesh-admin/eventmesh-admin-rocketmq/build.gradle
index a60dc14..1217b33 100644
--- a/eventmesh-sdk-java/build.gradle
+++ b/eventmesh-admin/eventmesh-admin-rocketmq/build.gradle
@@ -15,25 +15,16 @@
* limitations under the License.
*/
+
dependencies {
- implementation project(":eventmesh-common")
+ compileOnly project(":eventmesh-common")
+ implementation "org.apache.httpcomponents:httpclient"
implementation "com.fasterxml.jackson.core:jackson-databind"
implementation "com.fasterxml.jackson.core:jackson-core"
implementation "com.fasterxml.jackson.core:jackson-annotations"
- implementation "io.netty:netty-all"
- implementation "org.apache.httpcomponents:httpclient"
-
- // protocol
- implementation "io.cloudevents:cloudevents-core"
- implementation "io.cloudevents:cloudevents-json-jackson"
- implementation "io.openmessaging:openmessaging-api"
-
- compileOnly 'org.projectlombok:lombok:1.18.22'
- annotationProcessor 'org.projectlombok:lombok:1.18.22'
-
- testCompileOnly 'org.projectlombok:lombok:1.18.22'
- testAnnotationProcessor 'org.projectlombok:lombok:1.18.22'
+ implementation project(":eventmesh-connector-plugin:eventmesh-connector-api")
+ testImplementation project(":eventmesh-connector-plugin:eventmesh-connector-api")
}
diff --git a/eventmesh-connector-plugin/eventmesh-connector-rocketmq/src/main/resources/rocketmq-client.properties b/eventmesh-admin/eventmesh-admin-rocketmq/gradle.properties
similarity index 86%
copy from eventmesh-connector-plugin/eventmesh-connector-rocketmq/src/main/resources/rocketmq-client.properties
copy to eventmesh-admin/eventmesh-admin-rocketmq/gradle.properties
index 1261f30..3d49f4c 100644
--- a/eventmesh-connector-plugin/eventmesh-connector-rocketmq/src/main/resources/rocketmq-client.properties
+++ b/eventmesh-admin/eventmesh-admin-rocketmq/gradle.properties
@@ -1,4 +1,3 @@
-#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
@@ -14,5 +13,5 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-#######################rocketmq-client##################
-eventMesh.server.rocketmq.namesrvAddr=127.0.0.1:9876;127.0.0.1:9876
+
+rocketmq_version=4.7.1
\ No newline at end of file
diff --git a/eventmesh-admin/build.gradle b/eventmesh-admin/eventmesh-admin-rocketmq/src/main/java/org/apache/eventmesh/admin/rocketmq/controller/AdminController.java
similarity index 54%
copy from eventmesh-admin/build.gradle
copy to eventmesh-admin/eventmesh-admin-rocketmq/src/main/java/org/apache/eventmesh/admin/rocketmq/controller/AdminController.java
index 2bbbee2..8932afd 100644
--- a/eventmesh-admin/build.gradle
+++ b/eventmesh-admin/eventmesh-admin-rocketmq/src/main/java/org/apache/eventmesh/admin/rocketmq/controller/AdminController.java
@@ -15,5 +15,28 @@
* limitations under the License.
*/
-dependencies {
-}
\ No newline at end of file
+package org.apache.eventmesh.admin.rocketmq.controller;
+
+import org.apache.eventmesh.admin.rocketmq.handler.TopicsHandler;
+
+import java.io.IOException;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.sun.net.httpserver.HttpServer;
+
+public class AdminController {
+
+ private static final Logger logger = LoggerFactory.getLogger(AdminController.class);
+
+ public AdminController() {
+ }
+
+ public void run(HttpServer server) throws IOException {
+
+ server.createContext("/topicmanage", new TopicsHandler());
+
+ logger.info("EventMesh-Admin Controller server context created successfully");
+ }
+}
diff --git a/eventmesh-admin/eventmesh-admin-rocketmq/src/main/java/org/apache/eventmesh/admin/rocketmq/handler/TopicsHandler.java b/eventmesh-admin/eventmesh-admin-rocketmq/src/main/java/org/apache/eventmesh/admin/rocketmq/handler/TopicsHandler.java
new file mode 100644
index 0000000..345f4bc
--- /dev/null
+++ b/eventmesh-admin/eventmesh-admin-rocketmq/src/main/java/org/apache/eventmesh/admin/rocketmq/handler/TopicsHandler.java
@@ -0,0 +1,108 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.admin.rocketmq.handler;
+
+import org.apache.eventmesh.admin.rocketmq.request.TopicCreateRequest;
+import org.apache.eventmesh.admin.rocketmq.response.TopicResponse;
+import org.apache.eventmesh.admin.rocketmq.util.JsonUtils;
+import org.apache.eventmesh.admin.rocketmq.util.NetUtils;
+import org.apache.eventmesh.admin.rocketmq.util.RequestMapping;
+
+import org.apache.commons.lang3.StringUtils;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.sun.net.httpserver.HttpExchange;
+import com.sun.net.httpserver.HttpHandler;
+
+public class TopicsHandler implements HttpHandler {
+ private static final Logger logger = LoggerFactory.getLogger(TopicsHandler.class);
+
+ @Override
+ public void handle(HttpExchange httpExchange) throws IOException {
+
+ // create a new topic
+ if (RequestMapping.postMapping("/topicmanage", httpExchange)) {
+ createTopicHandler(httpExchange);
+ return;
+ }
+
+ OutputStream out = httpExchange.getResponseBody();
+ httpExchange.sendResponseHeaders(500, 0);
+ String result = String.format("Please check your request url");
+ logger.error(result);
+ out.write(result.getBytes());
+ return;
+ }
+
+ public void createTopicHandler(HttpExchange httpExchange) throws IOException {
+ String result = "";
+ OutputStream out = httpExchange.getResponseBody();
+ try {
+ String params = NetUtils.parsePostBody(httpExchange);
+ TopicCreateRequest topicCreateRequest =
+ JsonUtils.toObject(params, TopicCreateRequest.class);
+ String topic = topicCreateRequest.getName();
+
+ if (StringUtils.isBlank(topic)) {
+ result = "Create topic failed. Parameter topic not found.";
+ logger.error(result);
+ out.write(result.getBytes());
+ return;
+ }
+
+ //TBD: A new rocketmq service will be implemented for creating topics
+ TopicResponse topicResponse = null;
+ if (topicResponse != null) {
+ logger.info("create a new topic: {}", topic);
+ httpExchange.getResponseHeaders().add("Content-Type", "appication/json");
+ httpExchange.sendResponseHeaders(200, 0);
+ result = JsonUtils.toJson(topicResponse);
+ logger.info(result);
+ out.write(result.getBytes());
+ return;
+ } else {
+ httpExchange.sendResponseHeaders(500, 0);
+ result = String.format("create topic failed! Server side error");
+ logger.error(result);
+ out.write(result.getBytes());
+ return;
+ }
+ } catch (Exception e) {
+ httpExchange.getResponseHeaders().add("Content-Type", "appication/json");
+ httpExchange.sendResponseHeaders(500, 0);
+ result = String.format("create topic failed! Server side error");
+ logger.error(result);
+ out.write(result.getBytes());
+ return;
+ } finally {
+ if (out != null) {
+ try {
+ out.close();
+ } catch (IOException e) {
+ logger.warn("out close failed...", e);
+ }
+ }
+ }
+ }
+
+}
diff --git a/eventmesh-admin/build.gradle b/eventmesh-admin/eventmesh-admin-rocketmq/src/main/java/org/apache/eventmesh/admin/rocketmq/request/TopicCreateRequest.java
similarity index 51%
copy from eventmesh-admin/build.gradle
copy to eventmesh-admin/eventmesh-admin-rocketmq/src/main/java/org/apache/eventmesh/admin/rocketmq/request/TopicCreateRequest.java
index 2bbbee2..7adaa77 100644
--- a/eventmesh-admin/build.gradle
+++ b/eventmesh-admin/eventmesh-admin-rocketmq/src/main/java/org/apache/eventmesh/admin/rocketmq/request/TopicCreateRequest.java
@@ -15,5 +15,33 @@
* limitations under the License.
*/
-dependencies {
-}
\ No newline at end of file
+package org.apache.eventmesh.admin.rocketmq.request;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@JsonInclude(JsonInclude.Include.NON_EMPTY)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class TopicCreateRequest {
+
+ private String name;
+
+ @JsonCreator
+ public TopicCreateRequest(@JsonProperty("name") String topic) {
+ super();
+ this.name = topic;
+ }
+
+ @JsonProperty("name")
+ public String getName() {
+ return this.name;
+ }
+
+ @JsonProperty("name")
+ public void setName(String name) {
+ this.name = name;
+ }
+
+}
diff --git a/eventmesh-admin/eventmesh-admin-rocketmq/src/main/java/org/apache/eventmesh/admin/rocketmq/response/TopicResponse.java b/eventmesh-admin/eventmesh-admin-rocketmq/src/main/java/org/apache/eventmesh/admin/rocketmq/response/TopicResponse.java
new file mode 100644
index 0000000..1dde496
--- /dev/null
+++ b/eventmesh-admin/eventmesh-admin-rocketmq/src/main/java/org/apache/eventmesh/admin/rocketmq/response/TopicResponse.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.admin.rocketmq.response;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class TopicResponse {
+
+ private String topic;
+ private String createdTime;
+
+ @JsonCreator
+ public TopicResponse(@JsonProperty("topic") String topic,
+ @JsonProperty("created_time") String createdTime) {
+ super();
+ this.topic = topic;
+ this.createdTime = createdTime;
+ }
+
+ @JsonProperty("topic")
+ public String getTopic() {
+ return this.topic;
+ }
+
+ @JsonProperty("topic")
+ public void setTopic(String topic) {
+ this.topic = topic;
+ }
+
+ @JsonProperty("created_time")
+ public String getCreatedTime() {
+ return createdTime;
+ }
+
+ @JsonProperty("created_time")
+ public void setCreatedTime(String createdTime) {
+ this.createdTime = createdTime;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("TopicResponse {topic=" + this.topic + ",");
+ sb.append("created_time=" + this.createdTime + "}");
+ return sb.toString();
+ }
+
+}
diff --git a/eventmesh-admin/eventmesh-admin-rocketmq/src/main/java/org/apache/eventmesh/admin/rocketmq/util/JsonUtils.java b/eventmesh-admin/eventmesh-admin-rocketmq/src/main/java/org/apache/eventmesh/admin/rocketmq/util/JsonUtils.java
new file mode 100644
index 0000000..69455c5
--- /dev/null
+++ b/eventmesh-admin/eventmesh-admin-rocketmq/src/main/java/org/apache/eventmesh/admin/rocketmq/util/JsonUtils.java
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.admin.rocketmq.util;
+
+import java.io.IOException;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializationFeature;
+
+public class JsonUtils {
+
+ private static ObjectMapper objectMapper;
+
+ static {
+ objectMapper = new ObjectMapper();
+ objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
+ objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
+ objectMapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
+ }
+
+ public static <T> byte[] serialize(String topic, Class<T> data) throws JsonProcessingException {
+ if (data == null) {
+ return null;
+ }
+ return objectMapper.writeValueAsBytes(data);
+ }
+
+ public static String toJson(Object obj) throws JsonProcessingException {
+ if (obj == null) {
+ return null;
+ }
+ return objectMapper.writeValueAsString(obj);
+ }
+
+ public static <T> T toObject(String json, Class<T> clazz) throws JsonProcessingException {
+ return objectMapper.readValue(json, clazz);
+ }
+
+ public static <T> T deserialize(Class<T> clazz, byte[] bytes) throws IOException {
+ if (bytes == null || bytes.length == 0) {
+ return null;
+ }
+
+ return objectMapper.readValue(bytes, clazz);
+ }
+
+ public static <T> T deserialize(Class<T> clazz, String json) throws IOException {
+ if (json == null || json.length() == 0) {
+ return null;
+ }
+
+ return objectMapper.readValue(json, clazz);
+ }
+}
diff --git a/eventmesh-admin/eventmesh-admin-rocketmq/src/main/java/org/apache/eventmesh/admin/rocketmq/util/NetUtils.java b/eventmesh-admin/eventmesh-admin-rocketmq/src/main/java/org/apache/eventmesh/admin/rocketmq/util/NetUtils.java
new file mode 100644
index 0000000..c6c7992
--- /dev/null
+++ b/eventmesh-admin/eventmesh-admin-rocketmq/src/main/java/org/apache/eventmesh/admin/rocketmq/util/NetUtils.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.admin.rocketmq.util;
+
+import org.apache.http.Consts;
+
+import java.io.IOException;
+import java.io.InputStreamReader;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.sun.net.httpserver.HttpExchange;
+
+public class NetUtils {
+
+ private static final Logger logger = LoggerFactory.getLogger(NetUtils.class);
+
+ public static String parsePostBody(HttpExchange exchange)
+ throws IOException {
+ StringBuilder body = new StringBuilder();
+ if ("post".equalsIgnoreCase(exchange.getRequestMethod())
+ || "put".equalsIgnoreCase(exchange.getRequestMethod())) {
+ try (InputStreamReader reader =
+ new InputStreamReader(exchange.getRequestBody(), Consts.UTF_8)) {
+ char[] buffer = new char[256];
+ int read;
+ while ((read = reader.read(buffer)) != -1) {
+ body.append(buffer, 0, read);
+ }
+ }
+ }
+ return body.toString();
+ }
+}
+
diff --git a/eventmesh-admin/eventmesh-admin-rocketmq/src/main/java/org/apache/eventmesh/admin/rocketmq/util/RequestMapping.java b/eventmesh-admin/eventmesh-admin-rocketmq/src/main/java/org/apache/eventmesh/admin/rocketmq/util/RequestMapping.java
new file mode 100644
index 0000000..b093d3e
--- /dev/null
+++ b/eventmesh-admin/eventmesh-admin-rocketmq/src/main/java/org/apache/eventmesh/admin/rocketmq/util/RequestMapping.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.admin.rocketmq.util;
+
+import com.sun.net.httpserver.HttpExchange;
+
+public class RequestMapping {
+
+ public static boolean postMapping(String value, HttpExchange httpExchange) {
+ if ("post".equalsIgnoreCase(httpExchange.getRequestMethod())) {
+ String requestUri = httpExchange.getRequestURI().getPath();
+ UrlMappingPattern matcher = new UrlMappingPattern(value);
+ return matcher.matches(requestUri);
+ }
+ return false;
+ }
+
+ public static boolean getMapping(String value, HttpExchange httpExchange) {
+ if ("get".equalsIgnoreCase(httpExchange.getRequestMethod())) {
+ String requestUri = httpExchange.getRequestURI().getPath();
+ UrlMappingPattern matcher = new UrlMappingPattern(value);
+ return matcher.matches(requestUri);
+ }
+ return false;
+ }
+
+ public static boolean putMapping(String value, HttpExchange httpExchange) {
+ if ("put".equalsIgnoreCase(httpExchange.getRequestMethod())) {
+ String requestUri = httpExchange.getRequestURI().getPath();
+ UrlMappingPattern matcher = new UrlMappingPattern(value);
+ return matcher.matches(requestUri);
+ }
+ return false;
+ }
+
+ public static boolean deleteMapping(String value, HttpExchange httpExchange) {
+ if ("delete".equalsIgnoreCase(httpExchange.getRequestMethod())) {
+ String requestUri = httpExchange.getRequestURI().getPath();
+ UrlMappingPattern matcher = new UrlMappingPattern(value);
+ return matcher.matches(requestUri);
+ }
+ return false;
+ }
+
+}
diff --git a/eventmesh-admin/eventmesh-admin-rocketmq/src/main/java/org/apache/eventmesh/admin/rocketmq/util/UrlMappingPattern.java b/eventmesh-admin/eventmesh-admin-rocketmq/src/main/java/org/apache/eventmesh/admin/rocketmq/util/UrlMappingPattern.java
new file mode 100644
index 0000000..0e31b13
--- /dev/null
+++ b/eventmesh-admin/eventmesh-admin-rocketmq/src/main/java/org/apache/eventmesh/admin/rocketmq/util/UrlMappingPattern.java
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.admin.rocketmq.util;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class UrlMappingPattern {
+
+ private static final String URL_PARAMETER_REGEX = "\\{(\\w*?)\\}";
+
+ private static final String URL_PARAMETER_MATCH_REGEX =
+ "\\([%\\\\w-.\\\\~!\\$&'\\\\(\\\\)\\\\*\\\\+,;=:\\\\[\\\\]@]+?\\)";
+
+ private static final Pattern URL_PARAMETER_PATTERN = Pattern.compile(URL_PARAMETER_REGEX);
+
+ private static final String URL_FORMAT_REGEX = "(?:\\.\\{format\\})$";
+
+ private static final String URL_FORMAT_MATCH_REGEX = "(?:\\\\.\\([\\\\w%]+?\\))?";
+
+ private static final String URL_QUERY_STRING_REGEX = "(?:\\?.*?)?$";
+
+ private String urlMappingPattern;
+
+ private Pattern compiledUrlMappingPattern;
+
+ private List<String> paramNames = new ArrayList<String>();
+
+ public UrlMappingPattern(String pattern) {
+ super();
+ setUrlMappingPattern(pattern);
+ compile();
+ }
+
+ public String getMappingPattern() {
+ return getUrlMappingPattern().replaceFirst(URL_FORMAT_REGEX, "");
+ }
+
+ private String getUrlMappingPattern() {
+ return urlMappingPattern;
+ }
+
+ public Map<String, String> extractPathParameterValues(String url) {
+ Matcher matcher = compiledUrlMappingPattern.matcher(url);
+ if (matcher.matches()) {
+ return extractParameters(matcher);
+ }
+ return null;
+ }
+
+ public boolean matches(String url) {
+ return (extractPathParameterValues(url) != null);
+ }
+
+ public void compile() {
+ acquireParamNames();
+ String parsedPattern =
+ getUrlMappingPattern().replaceFirst(URL_FORMAT_REGEX, URL_FORMAT_MATCH_REGEX);
+ parsedPattern = parsedPattern.replaceAll(URL_PARAMETER_REGEX, URL_PARAMETER_MATCH_REGEX);
+ this.compiledUrlMappingPattern = Pattern.compile(parsedPattern + URL_QUERY_STRING_REGEX);
+ }
+
+ private void acquireParamNames() {
+ Matcher m = URL_PARAMETER_PATTERN.matcher(getUrlMappingPattern());
+ while (m.find()) {
+ paramNames.add(m.group(1));
+ }
+ }
+
+ private Map<String, String> extractParameters(Matcher matcher) {
+ Map<String, String> values = new HashMap<String, String>();
+ for (int i = 0; i < matcher.groupCount(); i++) {
+ String value = matcher.group(i + 1);
+
+ if (value != null) {
+ values.put(paramNames.get(i), value);
+ }
+ }
+ return values;
+ }
+
+ private void setUrlMappingPattern(String pattern) {
+ this.urlMappingPattern = pattern;
+ }
+
+ public List<String> getParamNames() {
+ return Collections.unmodifiableList(paramNames);
+ }
+}
diff --git a/eventmesh-common/build.gradle b/eventmesh-common/build.gradle
index 699e9c4..715ae91 100644
--- a/eventmesh-common/build.gradle
+++ b/eventmesh-common/build.gradle
@@ -16,21 +16,17 @@
*/
dependencies {
- api "org.apache.commons:commons-lang3"
- api "org.apache.commons:commons-collections4"
api "com.google.guava:guava"
api "org.slf4j:slf4j-api"
api "junit:junit"
api "org.assertj:assertj-core"
-
- implementation "commons-io:commons-io"
- implementation "org.apache.commons:commons-text"
+ api "org.apache.commons:commons-collections4"
+ api "org.apache.commons:commons-text"
+ api "org.apache.commons:commons-lang3"
implementation "org.apache.logging.log4j:log4j-api"
implementation "org.apache.logging.log4j:log4j-core"
- implementation "org.apache.logging.log4j:log4j-core"
implementation "org.apache.logging.log4j:log4j-slf4j-impl"
- implementation "org.apache.logging.log4j:log4j-web"
implementation "com.lmax:disruptor"
@@ -50,6 +46,25 @@ dependencies {
testCompileOnly 'org.projectlombok:lombok:1.18.22'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.22'
+ testImplementation "org.apache.commons:commons-lang3"
+
+ testImplementation "com.google.guava:guava"
+
+ testImplementation "org.slf4j:slf4j-api"
+ testImplementation "org.apache.logging.log4j:log4j-api"
+ testImplementation "org.apache.logging.log4j:log4j-core"
+ testImplementation "org.apache.logging.log4j:log4j-slf4j-impl"
+
+ testImplementation "com.lmax:disruptor"
+
+ testImplementation "com.fasterxml.jackson.core:jackson-databind"
+ testImplementation "com.fasterxml.jackson.core:jackson-core"
+ testImplementation "com.fasterxml.jackson.core:jackson-annotations"
+
+ testImplementation "org.apache.httpcomponents:httpclient"
+
+ testImplementation "io.netty:netty-all"
+
testImplementation "junit:junit"
testImplementation "org.assertj:assertj-core"
diff --git a/eventmesh-connector-plugin/eventmesh-connector-rocketmq/src/main/java/org/apache/eventmesh/connector/rocketmq/admin/command/Command.java b/eventmesh-connector-plugin/eventmesh-connector-rocketmq/src/main/java/org/apache/eventmesh/connector/rocketmq/admin/command/Command.java
new file mode 100644
index 0000000..82ca6a5
--- /dev/null
+++ b/eventmesh-connector-plugin/eventmesh-connector-rocketmq/src/main/java/org/apache/eventmesh/connector/rocketmq/admin/command/Command.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.connector.rocketmq.admin.command;
+
+import org.apache.eventmesh.connector.rocketmq.common.EventMeshConstants;
+import org.apache.eventmesh.connector.rocketmq.config.ClientConfiguration;
+import org.apache.eventmesh.connector.rocketmq.config.ConfigurationWrapper;
+
+import org.apache.rocketmq.acl.common.AclClientRPCHook;
+import org.apache.rocketmq.acl.common.SessionCredentials;
+import org.apache.rocketmq.remoting.RPCHook;
+import org.apache.rocketmq.tools.admin.DefaultMQAdminExt;
+
+import java.io.File;
+import java.util.UUID;
+
+public abstract class Command {
+ protected DefaultMQAdminExt adminExt;
+
+ protected String nameServerAddr;
+ protected String clusterName;
+
+ public void init() {
+ ConfigurationWrapper configurationWrapper =
+ new ConfigurationWrapper(EventMeshConstants.EVENTMESH_CONF_HOME
+ + File.separator
+ + EventMeshConstants.EVENTMESH_CONF_FILE, false);
+ final ClientConfiguration clientConfiguration =
+ new ClientConfiguration(configurationWrapper);
+ clientConfiguration.init();
+
+ nameServerAddr = clientConfiguration.namesrvAddr;
+ clusterName = clientConfiguration.clusterName;
+ String accessKey = clientConfiguration.accessKey;
+ String secretKey = clientConfiguration.secretKey;
+
+ RPCHook rpcHook = new AclClientRPCHook(new SessionCredentials(accessKey, secretKey));
+ adminExt = new DefaultMQAdminExt(rpcHook);
+ String groupId = UUID.randomUUID().toString();
+ adminExt.setAdminExtGroup("admin_ext_group-" + groupId);
+ adminExt.setNamesrvAddr(nameServerAddr);
+ }
+
+ public abstract void execute() throws Exception;
+}
diff --git a/eventmesh-connector-plugin/eventmesh-connector-rocketmq/src/main/java/org/apache/eventmesh/connector/rocketmq/admin/command/CreateTopicCommand.java b/eventmesh-connector-plugin/eventmesh-connector-rocketmq/src/main/java/org/apache/eventmesh/connector/rocketmq/admin/command/CreateTopicCommand.java
new file mode 100644
index 0000000..53f1822
--- /dev/null
+++ b/eventmesh-connector-plugin/eventmesh-connector-rocketmq/src/main/java/org/apache/eventmesh/connector/rocketmq/admin/command/CreateTopicCommand.java
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.connector.rocketmq.admin.command;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.rocketmq.common.TopicConfig;
+import org.apache.rocketmq.tools.command.CommandUtil;
+
+import java.util.Set;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class CreateTopicCommand extends Command {
+ public Logger logger = LoggerFactory.getLogger(this.getClass());
+
+ private int numOfQueue = 4;
+ private int queuePermission = 6;
+ private String topicName = "";
+
+ @Override
+ public void execute() throws Exception {
+ if (StringUtils.isBlank(topicName)) {
+ logger.error("Topic name can not be blank.");
+ throw new Exception("Topic name can not be blank.");
+ }
+ try {
+ init();
+ adminExt.start();
+ Set<String> brokersAddr = CommandUtil.fetchMasterAddrByClusterName(
+ adminExt, clusterName);
+ for (String masterAddr : brokersAddr) {
+ TopicConfig topicConfig = new TopicConfig();
+ topicConfig.setTopicName(topicName);
+ topicConfig.setReadQueueNums(numOfQueue);
+ topicConfig.setWriteQueueNums(numOfQueue);
+ topicConfig.setPerm(queuePermission);
+ adminExt.createAndUpdateTopicConfig(masterAddr, topicConfig);
+ logger.info("Topic {} is created for RocketMQ broker {}", topicName, masterAddr);
+ }
+ } finally {
+ adminExt.shutdown();
+ }
+ }
+
+ public int getNumOfQueue() {
+ return numOfQueue;
+ }
+
+ public int getQueuePermission() {
+ return queuePermission;
+ }
+
+ public String getTopicName() {
+ return topicName;
+ }
+
+ public void setTopicName(String topicName) {
+ this.topicName = topicName;
+ }
+
+ public void setNumOfQueue(int numOfQueue) {
+ this.numOfQueue = numOfQueue;
+ }
+
+ public void setQueuePermission(int permission) {
+ this.queuePermission = permission;
+ }
+}
diff --git a/eventmesh-connector-plugin/eventmesh-connector-rocketmq/src/main/java/org/apache/eventmesh/connector/rocketmq/config/ClientConfiguration.java b/eventmesh-connector-plugin/eventmesh-connector-rocketmq/src/main/java/org/apache/eventmesh/connector/rocketmq/config/ClientConfiguration.java
index f1b9335..feadca6 100644
--- a/eventmesh-connector-plugin/eventmesh-connector-rocketmq/src/main/java/org/apache/eventmesh/connector/rocketmq/config/ClientConfiguration.java
+++ b/eventmesh-connector-plugin/eventmesh-connector-rocketmq/src/main/java/org/apache/eventmesh/connector/rocketmq/config/ClientConfiguration.java
@@ -36,6 +36,9 @@ public class ClientConfiguration {
public Integer pollNameServerInterval = 10 * 1000;
public Integer heartbeatBrokerInterval = 30 * 1000;
public Integer rebalanceInterval = 20 * 1000;
+ public String clusterName = "";
+ public String accessKey = "";
+ public String secretKey = "";
protected ConfigurationWrapper configurationWrapper;
@@ -101,13 +104,17 @@ public class ClientConfiguration {
pullBatchSize = Integer.valueOf(clientPullBatchSizeStr);
}
- String clientPollNamesrvIntervalStr = configurationWrapper.getProp(ConfKeys.KEYS_EVENTMESH_ROCKETMQ_CLIENT_POLL_NAMESRV_INTERVAL);
+ String clientPollNamesrvIntervalStr =
+ configurationWrapper.getProp(
+ ConfKeys.KEYS_EVENTMESH_ROCKETMQ_CLIENT_POLL_NAMESRV_INTERVAL);
if (StringUtils.isNotEmpty(clientPollNamesrvIntervalStr)) {
Preconditions.checkState(StringUtils.isNumeric(clientPollNamesrvIntervalStr), String.format("%s error", ConfKeys.KEYS_EVENTMESH_ROCKETMQ_CLIENT_POLL_NAMESRV_INTERVAL));
pollNameServerInterval = Integer.valueOf(clientPollNamesrvIntervalStr);
}
- String clientHeartbeatBrokerIntervalStr = configurationWrapper.getProp(ConfKeys.KEYS_EVENTMESH_ROCKETMQ_CLIENT_HEARTBEAT_BROKER_INTERVAL);
+ String clientHeartbeatBrokerIntervalStr =
+ configurationWrapper.getProp(
+ ConfKeys.KEYS_EVENTMESH_ROCKETMQ_CLIENT_HEARTBEAT_BROKER_INTERVAL);
if (StringUtils.isNotEmpty(clientHeartbeatBrokerIntervalStr)) {
Preconditions.checkState(StringUtils.isNumeric(clientHeartbeatBrokerIntervalStr), String.format("%s error", ConfKeys.KEYS_EVENTMESH_ROCKETMQ_CLIENT_HEARTBEAT_BROKER_INTERVAL));
heartbeatBrokerInterval = Integer.valueOf(clientHeartbeatBrokerIntervalStr);
@@ -118,6 +125,21 @@ public class ClientConfiguration {
Preconditions.checkState(StringUtils.isNumeric(clientRebalanceIntervalIntervalStr), String.format("%s error", ConfKeys.KEYS_EVENTMESH_ROCKETMQ_CLIENT_REBALANCE_INTERVAL));
rebalanceInterval = Integer.valueOf(clientRebalanceIntervalIntervalStr);
}
+
+ String cluster = configurationWrapper.getProp(ConfKeys.KEYS_EVENTMESH_ROCKETMQ_CLUSTER);
+ if (StringUtils.isNotBlank(cluster)) {
+ clusterName = cluster;
+ }
+
+ String ak = configurationWrapper.getProp(ConfKeys.KEYS_EVENTMESH_ROCKETMQ_ACCESS_KEY);
+ if (StringUtils.isNotBlank(ak)) {
+ accessKey = ak;
+ }
+
+ String sk = configurationWrapper.getProp(ConfKeys.KEYS_EVENTMESH_ROCKETMQ_SECRET_KEY);
+ if (StringUtils.isNotBlank(sk)) {
+ secretKey = sk;
+ }
}
static class ConfKeys {
@@ -147,6 +169,14 @@ public class ClientConfiguration {
public static String KEYS_EVENTMESH_ROCKETMQ_CLIENT_HEARTBEAT_BROKER_INTERVAL = "eventMesh.server.rocketmq.client.heartbeatBrokerInterval";
public static String KEYS_EVENTMESH_ROCKETMQ_CLIENT_REBALANCE_INTERVAL = "eventMesh.server.rocketmq.client.rebalanceInterval";
+
+ public static String KEYS_EVENTMESH_ROCKETMQ_CLUSTER = "eventMesh.server.rocketmq.cluster";
+
+ public static String KEYS_EVENTMESH_ROCKETMQ_ACCESS_KEY =
+ "eventMesh.server.rocketmq.accessKey";
+
+ public static String KEYS_EVENTMESH_ROCKETMQ_SECRET_KEY =
+ "eventMesh.server.rocketmq.secretKey";
}
}
\ No newline at end of file
diff --git a/eventmesh-connector-plugin/eventmesh-connector-rocketmq/src/main/resources/rocketmq-client.properties b/eventmesh-connector-plugin/eventmesh-connector-rocketmq/src/main/resources/rocketmq-client.properties
index 1261f30..8e0822a 100644
--- a/eventmesh-connector-plugin/eventmesh-connector-rocketmq/src/main/resources/rocketmq-client.properties
+++ b/eventmesh-connector-plugin/eventmesh-connector-rocketmq/src/main/resources/rocketmq-client.properties
@@ -16,3 +16,6 @@
#
#######################rocketmq-client##################
eventMesh.server.rocketmq.namesrvAddr=127.0.0.1:9876;127.0.0.1:9876
+eventMesh.server.rocketmq.cluster=DefaultCluster
+eventMesh.server.rocketmq.accessKey=********
+eventMesh.server.rocketmq.secretKey=********
diff --git a/eventmesh-connector-plugin/eventmesh-connector-rocketmq/src/test/java/org/apache/eventmesh/producer/DefaultProducerImplTest.java b/eventmesh-connector-plugin/eventmesh-connector-rocketmq/src/test/java/org/apache/eventmesh/producer/DefaultProducerImplTest.java
new file mode 100644
index 0000000..16ff257
--- /dev/null
+++ b/eventmesh-connector-plugin/eventmesh-connector-rocketmq/src/test/java/org/apache/eventmesh/producer/DefaultProducerImplTest.java
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.producer;
+
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import org.apache.eventmesh.api.producer.MeshMQProducer;
+import org.apache.eventmesh.connector.rocketmq.producer.RocketMQProducerImpl;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import io.openmessaging.api.exception.OMSRuntimeException;
+
+public class DefaultProducerImplTest {
+
+ @Before
+ public void before() {}
+
+
+ @After
+ public void after() {
+ //TBD:Remove topic
+ }
+
+ @Test
+ public void testCreate_EmptyTopic() {
+ MeshMQProducer meshPub = new RocketMQProducerImpl();
+ try {
+ meshPub.createTopic(" ");
+ } catch (OMSRuntimeException e) {
+ assertThat(e.getMessage()).isEqualToIgnoringWhitespace("RocketMQ can not create topic");
+ }
+ }
+
+ @Test
+ public void testCreate_NullTopic() {
+ MeshMQProducer meshPub = new RocketMQProducerImpl();
+ try {
+ meshPub.createTopic(null);
+ } catch (OMSRuntimeException e) {
+ String errorMessage = e.getMessage();
+ assertThat(errorMessage).isEqualTo("RocketMQ can not create topic null");
+ }
+ }
+}
\ No newline at end of file
diff --git a/eventmesh-connector-plugin/eventmesh-connector-standalone/src/main/java/org/apache/eventmesh/connector/standalone/producer/StandaloneMeshMQProducerAdaptor.java b/eventmesh-connector-plugin/eventmesh-connector-standalone/src/main/java/org/apache/eventmesh/connector/standalone/producer/StandaloneMeshMQProducerAdaptor.java
new file mode 100644
index 0000000..e69de29
diff --git a/eventmesh-runtime/build.gradle b/eventmesh-runtime/build.gradle
index 5bf0df2..e4e1903 100644
--- a/eventmesh-runtime/build.gradle
+++ b/eventmesh-runtime/build.gradle
@@ -35,13 +35,30 @@ dependencies {
implementation project(":eventmesh-security-plugin:eventmesh-security-acl")
implementation project(":eventmesh-registry-plugin:eventmesh-registry-api")
implementation project(":eventmesh-registry-plugin:eventmesh-registry-namesrv")
+ implementation project(":eventmesh-admin:eventmesh-admin-rocketmq")
implementation project(":eventmesh-protocol-plugin:eventmesh-protocol-api")
+
// for debug only, can be removed
implementation project(":eventmesh-protocol-plugin:eventmesh-protocol-cloudevents")
implementation project(":eventmesh-protocol-plugin:eventmesh-protocol-meshmessage")
implementation project(":eventmesh-protocol-plugin:eventmesh-protocol-openmessage")
+ testImplementation project(":eventmesh-common")
+ testImplementation project(":eventmesh-spi")
+ testImplementation project(":eventmesh-connector-plugin:eventmesh-connector-api")
+ testImplementation project(":eventmesh-connector-plugin:eventmesh-connector-standalone")
+ testImplementation project(":eventmesh-security-plugin:eventmesh-security-api")
+ testImplementation project(":eventmesh-security-plugin:eventmesh-security-acl")
+ testImplementation project(":eventmesh-registry-plugin:eventmesh-registry-api")
+ testImplementation project(":eventmesh-registry-plugin:eventmesh-registry-namesrv")
+ testImplementation project(":eventmesh-admin:eventmesh-admin-rocketmq")
+
+ testImplementation project(":eventmesh-protocol-plugin:eventmesh-protocol-api")
+
+ testImplementation "org.apache.httpcomponents:httpclient"
+ testImplementation "io.netty:netty-all"
+
testImplementation "org.mockito:mockito-core"
testImplementation "org.powermock:powermock-module-junit4"
testImplementation "org.powermock:powermock-api-mockito2"
diff --git a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/controller/ClientManageController.java b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/controller/ClientManageController.java
index cd6d094..3fc2e8e 100644
--- a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/controller/ClientManageController.java
+++ b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/controller/ClientManageController.java
@@ -17,21 +17,34 @@
package org.apache.eventmesh.runtime.admin.controller;
+import org.apache.eventmesh.admin.rocketmq.controller.AdminController;
+import org.apache.eventmesh.runtime.admin.handler.QueryRecommendEventMeshHandler;
+import org.apache.eventmesh.runtime.admin.handler.RedirectClientByIpPortHandler;
+import org.apache.eventmesh.runtime.admin.handler.RedirectClientByPathHandler;
+import org.apache.eventmesh.runtime.admin.handler.RedirectClientBySubSystemHandler;
+import org.apache.eventmesh.runtime.admin.handler.RejectAllClientHandler;
+import org.apache.eventmesh.runtime.admin.handler.RejectClientByIpPortHandler;
+import org.apache.eventmesh.runtime.admin.handler.RejectClientBySubSystemHandler;
+import org.apache.eventmesh.runtime.admin.handler.ShowClientBySystemHandler;
+import org.apache.eventmesh.runtime.admin.handler.ShowClientHandler;
+import org.apache.eventmesh.runtime.admin.handler.ShowListenClientByTopicHandler;
+import org.apache.eventmesh.runtime.boot.EventMeshTCPServer;
+
import java.io.IOException;
import java.net.InetSocketAddress;
-import com.sun.net.httpserver.HttpServer;
-
-import org.apache.eventmesh.runtime.admin.handler.*;
-import org.apache.eventmesh.runtime.boot.EventMeshTCPServer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import com.sun.net.httpserver.HttpServer;
+
public class ClientManageController {
private static final Logger logger = LoggerFactory.getLogger(ClientManageController.class);
private EventMeshTCPServer eventMeshTCPServer;
+
+ private AdminController adminController;
public ClientManageController(EventMeshTCPServer eventMeshTCPServer) {
this.eventMeshTCPServer = eventMeshTCPServer;
@@ -50,6 +63,10 @@ public class ClientManageController {
server.createContext("/clientManage/redirectClientByIpPort", new RedirectClientByIpPortHandler(eventMeshTCPServer));
server.createContext("/clientManage/showListenClientByTopic", new ShowListenClientByTopicHandler(eventMeshTCPServer));
server.createContext("/eventMesh/recommend", new QueryRecommendEventMeshHandler(eventMeshTCPServer));
+
+ adminController = new AdminController();
+ adminController.run(server);
+
server.start();
logger.info("ClientManageController start success, port:{}", port);
}
diff --git a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/http/processor/SubscribeProcessor.java b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/http/processor/SubscribeProcessor.java
index 02e1c1e..0c75e7a 100644
--- a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/http/processor/SubscribeProcessor.java
+++ b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/http/processor/SubscribeProcessor.java
@@ -70,7 +70,7 @@ public class SubscribeProcessor implements HttpRequestProcessor {
@Override
public void processRequest(ChannelHandlerContext ctx, AsyncContext<HttpCommand> asyncContext)
- throws Exception {
+ throws Exception {
HttpCommand responseEventMeshCommand;
final HttpCommand request = asyncContext.getRequest();
final Integer requestCode = Integer.valueOf(asyncContext.getRequest().getRequestCode());
@@ -107,8 +107,8 @@ public class SubscribeProcessor implements HttpRequestProcessor {
//validate body
if (StringUtils.isBlank(subscribeRequestBody.getUrl())
- || CollectionUtils.isEmpty(subscribeRequestBody.getTopics())
- || StringUtils.isBlank(subscribeRequestBody.getConsumerGroup())) {
+ || CollectionUtils.isEmpty(subscribeRequestBody.getTopics())
+ || StringUtils.isBlank(subscribeRequestBody.getConsumerGroup())) {
responseEventMeshCommand = request.createHttpCommandResponse(
subscribeResponseHeader,
@@ -129,17 +129,17 @@ public class SubscribeProcessor implements HttpRequestProcessor {
for (SubscriptionItem item : subTopicList) {
try {
Acl.doAclCheckInHttpReceive(remoteAddr, user, pass, subsystem, item.getTopic(),
- requestCode);
+ requestCode);
} catch (Exception e) {
responseEventMeshCommand = asyncContext.getRequest().createHttpCommandResponse(
- subscribeResponseHeader,
- SendMessageResponseBody
- .buildBody(EventMeshRetCode.EVENTMESH_ACL_ERR.getRetCode(),
- e.getMessage()));
+ subscribeResponseHeader,
+ SendMessageResponseBody
+ .buildBody(EventMeshRetCode.EVENTMESH_ACL_ERR.getRetCode(),
+ e.getMessage()));
asyncContext.onComplete(responseEventMeshCommand);
aclLogger
- .warn("CLIENT HAS NO PERMISSION,SubscribeProcessor subscribe failed", e);
+ .warn("CLIENT HAS NO PERMISSION,SubscribeProcessor subscribe failed", e);
return;
}
}
@@ -154,7 +154,7 @@ public class SubscribeProcessor implements HttpRequestProcessor {
for (SubscriptionItem subTopic : subTopicList) {
List<Client> groupTopicClients = eventMeshHTTPServer.localClientInfoMapping
- .get(consumerGroup + "@" + subTopic.getTopic());
+ .get(consumerGroup + "@" + subTopic.getTopic());
if (CollectionUtils.isEmpty(groupTopicClients)) {
httpLogger.error("group {} topic {} clients is empty", consumerGroup, subTopic);
@@ -171,7 +171,7 @@ public class SubscribeProcessor implements HttpRequestProcessor {
}
}
ConsumerGroupConf consumerGroupConf =
- eventMeshHTTPServer.localConsumerGroupMapping.get(consumerGroup);
+ eventMeshHTTPServer.localConsumerGroupMapping.get(consumerGroup);
if (consumerGroupConf == null) {
// new subscription
consumerGroupConf = new ConsumerGroupConf(consumerGroup);
@@ -189,7 +189,17 @@ public class SubscribeProcessor implements HttpRequestProcessor {
} else {
// already subscribed
Map<String, ConsumerGroupTopicConf> map =
- consumerGroupConf.getConsumerGroupTopicConf();
+ consumerGroupConf.getConsumerGroupTopicConf();
+ if (!map.containsKey(subTopic.getTopic())) {
+ //If there are multiple topics, append it
+ ConsumerGroupTopicConf newTopicConf = new ConsumerGroupTopicConf();
+ newTopicConf.setConsumerGroup(consumerGroup);
+ newTopicConf.setTopic(subTopic.getTopic());
+ newTopicConf.setSubscriptionItem(subTopic);
+ newTopicConf.setUrls(new HashSet<>(Arrays.asList(url)));
+ newTopicConf.setIdcUrls(idcUrls);
+ map.put(subTopic.getTopic(), newTopicConf);
+ }
for (String key : map.keySet()) {
if (StringUtils.equals(subTopic.getTopic(), key)) {
ConsumerGroupTopicConf latestTopicConf = new ConsumerGroupTopicConf();
@@ -203,15 +213,6 @@ public class SubscribeProcessor implements HttpRequestProcessor {
latestTopicConf.setIdcUrls(idcUrls);
map.put(key, latestTopicConf);
- } else {
- //If there are multiple topics, append it
- ConsumerGroupTopicConf newTopicConf = new ConsumerGroupTopicConf();
- newTopicConf.setConsumerGroup(consumerGroup);
- newTopicConf.setTopic(subTopic.getTopic());
- newTopicConf.setSubscriptionItem(subTopic);
- newTopicConf.setUrls(new HashSet<>(Arrays.asList(url)));
- newTopicConf.setIdcUrls(idcUrls);
- map.put(subTopic.getTopic(), newTopicConf);
}
}
}
@@ -222,7 +223,7 @@ public class SubscribeProcessor implements HttpRequestProcessor {
try {
// subscription relationship change notification
eventMeshHTTPServer.getConsumerManager().notifyConsumerManager(consumerGroup,
- eventMeshHTTPServer.localConsumerGroupMapping.get(consumerGroup));
+ eventMeshHTTPServer.localConsumerGroupMapping.get(consumerGroup));
final CompleteHandler<HttpCommand> handler = new CompleteHandler<HttpCommand>() {
@Override
@@ -244,18 +245,18 @@ public class SubscribeProcessor implements HttpRequestProcessor {
asyncContext.onComplete(responseEventMeshCommand, handler);
} catch (Exception e) {
HttpCommand err = asyncContext.getRequest().createHttpCommandResponse(
- subscribeResponseHeader,
- SubscribeResponseBody
- .buildBody(EventMeshRetCode.EVENTMESH_SUBSCRIBE_ERR.getRetCode(),
- EventMeshRetCode.EVENTMESH_SUBSCRIBE_ERR.getErrMsg()
- + EventMeshUtil.stackTrace(e, 2)));
+ subscribeResponseHeader,
+ SubscribeResponseBody
+ .buildBody(EventMeshRetCode.EVENTMESH_SUBSCRIBE_ERR.getRetCode(),
+ EventMeshRetCode.EVENTMESH_SUBSCRIBE_ERR.getErrMsg()
+ + EventMeshUtil.stackTrace(e, 2)));
asyncContext.onComplete(err);
long endTime = System.currentTimeMillis();
httpLogger.error(
- "message|eventMesh2mq|REQ|ASYNC|send2MQCost={}ms|topic={}"
- + "|bizSeqNo={}|uniqueId={}", endTime - startTime,
- JsonUtils.serialize(subscribeRequestBody.getTopics()),
- subscribeRequestBody.getUrl(), e);
+ "message|eventMesh2mq|REQ|ASYNC|send2MQCost={}ms|topic={}"
+ + "|bizSeqNo={}|uniqueId={}", endTime - startTime,
+ JsonUtils.serialize(subscribeRequestBody.getTopics()),
+ subscribeRequestBody.getUrl(), e);
eventMeshHTTPServer.metrics.summaryMetrics.recordSendMsgFailed();
eventMeshHTTPServer.metrics.summaryMetrics.recordSendMsgCost(endTime - startTime);
}
@@ -285,7 +286,7 @@ public class SubscribeProcessor implements HttpRequestProcessor {
if (eventMeshHTTPServer.localClientInfoMapping.containsKey(groupTopicKey)) {
List<Client> localClients =
- eventMeshHTTPServer.localClientInfoMapping.get(groupTopicKey);
+ eventMeshHTTPServer.localClientInfoMapping.get(groupTopicKey);
boolean isContains = false;
for (Client localClient : localClients) {
if (StringUtils.equals(localClient.url, client.url)) {
diff --git a/eventmesh-sdk-java/build.gradle b/eventmesh-sdk-java/build.gradle
index a60dc14..7b91767 100644
--- a/eventmesh-sdk-java/build.gradle
+++ b/eventmesh-sdk-java/build.gradle
@@ -21,6 +21,7 @@ dependencies {
implementation "com.fasterxml.jackson.core:jackson-databind"
implementation "com.fasterxml.jackson.core:jackson-core"
implementation "com.fasterxml.jackson.core:jackson-annotations"
+ implementation "org.apache.commons:commons-collections4"
implementation "io.netty:netty-all"
implementation "org.apache.httpcomponents:httpclient"
@@ -30,6 +31,15 @@ dependencies {
implementation "io.cloudevents:cloudevents-json-jackson"
implementation "io.openmessaging:openmessaging-api"
+ testImplementation project(":eventmesh-common")
+
+ testImplementation "com.fasterxml.jackson.core:jackson-databind"
+ testImplementation "com.fasterxml.jackson.core:jackson-core"
+ testImplementation "com.fasterxml.jackson.core:jackson-annotations"
+
+ testImplementation "io.netty:netty-all"
+ testImplementation "org.apache.httpcomponents:httpclient"
+
compileOnly 'org.projectlombok:lombok:1.18.22'
annotationProcessor 'org.projectlombok:lombok:1.18.22'
diff --git a/eventmesh-spi/build.gradle b/eventmesh-spi/build.gradle
index f5933ae..0911a87 100644
--- a/eventmesh-spi/build.gradle
+++ b/eventmesh-spi/build.gradle
@@ -16,4 +16,6 @@
*/
dependencies {
compileOnly project(":eventmesh-common")
+ implementation "org.apache.commons:commons-collections4"
+ testImplementation project(":eventmesh-common")
}
\ No newline at end of file
diff --git a/gradle.properties b/gradle.properties
index 73dc286..d51e958 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -30,3 +30,5 @@ apacheUserName=
#apache password
apachePassWord=
signEnabled=false
+
+org.gradle.warning.mode=none
diff --git a/settings.gradle b/settings.gradle
index 0606b2e..fa13c1e 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -30,7 +30,6 @@ include 'eventmesh-security-plugin:eventmesh-security-api'
include 'eventmesh-security-plugin:eventmesh-security-acl'
include 'eventmesh-registry-plugin:eventmesh-registry-api'
include 'eventmesh-registry-plugin:eventmesh-registry-namesrv'
-include 'eventmesh-admin'
include 'eventmesh-schema-registry'
include 'eventmesh-schema-registry:eventmesh-schema-registry-server'
include 'eventmesh-protocol-plugin'
@@ -38,4 +37,5 @@ include 'eventmesh-protocol-plugin:eventmesh-protocol-api'
include 'eventmesh-protocol-plugin:eventmesh-protocol-openmessage'
include 'eventmesh-protocol-plugin:eventmesh-protocol-cloudevents'
include 'eventmesh-protocol-plugin:eventmesh-protocol-meshmessage'
+include 'eventmesh-admin:eventmesh-admin-rocketmq'
diff --git a/style/checkStyle.xml b/style/checkStyle.xml
index 842f960..17f5d40 100644
--- a/style/checkStyle.xml
+++ b/style/checkStyle.xml
@@ -54,7 +54,7 @@
<module name="LineLength">
<property name="fileExtensions" value="java"/>
- <property name="max" value="120"/>
+ <property name="max" value="150"/>
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
</module>
@@ -73,6 +73,7 @@
<property name="allowNonPrintableEscapes" value="true"/>
</module>
<module name="AvoidStarImport"/>
+ <!--
<module name="ImportOrder">
<property name="staticGroups" value="org.apache.eventmesh,org.apache,java,javax,org,com"/>
<property name="separatedStaticGroups" value="true"/>
@@ -82,6 +83,7 @@
<property name="option" value="top"/>
<property name="sortStaticImportsAlphabetically" value="true"/>
</module>
+ -->
<module name="OneTopLevelClass"/>
<module name="NoLineWrap">
<property name="tokens" value="PACKAGE_DEF, IMPORT, STATIC_IMPORT"/>
@@ -262,13 +264,15 @@
</module>
<module name="Indentation">
<property name="basicOffset" value="4"/>
+ <property name="braceAdjustment" value="2"/>
+ <property name="caseIndent" value="2"/>
<property name="throwsIndent" value="4"/>
<property name="lineWrappingIndentation" value="4"/>
<property name="arrayInitIndent" value="2"/>
</module>
<module name="AbbreviationAsWordInName">
<property name="ignoreFinal" value="false"/>
- <property name="allowedAbbreviationLength" value="0"/>
+ <!--<property name="allowedAbbreviationLength" value="0"/>-->
<property name="tokens"
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, ANNOTATION_DEF, ANNOTATION_FIELD_DEF,
PARAMETER_DEF, VARIABLE_DEF, METHOD_DEF, PATTERN_VARIABLE_DEF, RECORD_DEF,
@@ -313,20 +317,24 @@
<property name="tokens" value="VARIABLE_DEF"/>
<property name="allowSamelineMultipleAnnotations" value="true"/>
</module>
- <module name="NonEmptyAtclauseDescription"/>
- <module name="InvalidJavadocPosition"/>
- <module name="JavadocTagContinuationIndentation"/>
+ <!--<module name="NonEmptyAtclauseDescription"/>-->
+ <!--<module name="InvalidJavadocPosition"/>
+ <module name="JavadocTagContinuationIndentation"/>-->
+ <!--
<module name="SummaryJavadoc">
<property name="forbiddenSummaryFragments"
value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
</module>
- <module name="JavadocParagraph"/>
+ -->
+ <!--<module name="JavadocParagraph"/>
<module name="RequireEmptyLineBeforeBlockTagGroup"/>
<module name="AtclauseOrder">
<property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
<property name="target"
value="CLASS_DEF, ENUM_DEF, METHOD_DEF, VARIABLE_DEF"/>
</module>
+ -->
+ <!--
<module name="JavadocMethod">
<property name="accessModifiers" value="public"/>
<property name="allowMissingParamTags" value="true"/>
@@ -340,12 +348,13 @@
value="INTERFACE_DEF"/>
<property name="excludeScope" value="nothing"/>
</module>
+ -->
<module name="MethodName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
<message key="name.invalidPattern"
value="Method name ''{0}'' must match pattern ''{1}''."/>
</module>
- <module name="SingleLineJavadoc"/>
+ <!--<module name="SingleLineJavadoc"/>-->
<module name="EmptyCatchBlock">
<property name="exceptionVariableName" value="expected"/>
</module>
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: commits-help@eventmesh.apache.org