Skip to content

Commit

Permalink
[ISSUE #4275] Support subscription info management with eventmesh-adm…
Browse files Browse the repository at this point in the history
…in module (#4468)

* init: Spring Initializr

* init: add basic configurations and dependencies

* init: merge Gradle Groovy DSL to Kotlin DSL

* fix: resolve springdoc compatibility and select kotlin as DSL

* config: use nacos, REVERT BEFORE MERGE

* dep: nacos-client dependency and test endpoint

* config: use rocketmq connector, REVERT BEFORE MERGE

* dep: fix springdoc version

* config: connector namesrv, REVERT BEFORE MERGE

* feat: Realize multi-implements based on config

* feat: get one nacos config by dataId

* feat: get nacos config list with OpenAPI

* chore: fix checkstyle

* feat: config content base64 encode

* feat: use json to output Session toString

* optimize: endpoint support returning error message

* optimize: return an object instead of JSON string

* Revert config changes

* Use Gradle Groovy DSL instead of Kotlin DSL

* feat: support for building and running with docker
  • Loading branch information
Pil0tXia authored Oct 6, 2023
1 parent 05900d0 commit b6f9ca5
Show file tree
Hide file tree
Showing 35 changed files with 1,619 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

public class EventMeshException extends RuntimeException {

public static final long serialVersionUID = 5648256502005456586L;
private static final long serialVersionUID = 5648256502005456586L;

public EventMeshException(String message) {
super(message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pubSubConfig:
passWord: rocketmqPassWord
connectorConfig:
connectorName: rocketmqSource
nameserver: 127.0.0.1:9877
nameserver: 127.0.0.1:9876
topic: TopicTest
commitOffsetIntervalMs: 5000
offsetStorageConfig:
Expand Down
36 changes: 36 additions & 0 deletions eventmesh-console/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/
24 changes: 24 additions & 0 deletions eventmesh-console/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Getting Started

## Build on source code

```
cd eventmesh-console
./gradlew clean bootJar
```

```
java -jar build/libs/eventmesh-console-0.0.1-SNAPSHOT.jar
```

## Build and Run with Docker

```
cd eventmesh-console
./gradlew clean bootJar
docker build -t yourname/eventmesh-console -f docker/Dockerfile .
```

```
docker run -d --name eventmesh-console -p 8080:8080 yourname/eventmesh-console
```
80 changes: 80 additions & 0 deletions eventmesh-console/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/*
* 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.
*/

plugins {
id 'java'
id 'idea'
id 'org.springframework.boot' version '2.7.15'
id 'io.spring.dependency-management' version '1.0.15.RELEASE'
}

group = 'org.apache.eventmesh'
version = '0.0.1-SNAPSHOT'

java {
sourceCompatibility = '1.8'
}

configurations {
compileOnly {
extendsFrom annotationProcessor
}
}

repositories {
mavenCentral()
maven { url 'https://maven.aliyun.com/repository/public/' }
}

ext {
// utility
commonsLang3Version = '3.13.0'
guavaVersion = '32.1.2-jre' // not used for now
fastjsonVersion = '2.0.40'
// swagger
springdocVersion = '1.7.0'
// unit test
mockitoVersion = '5.5.0'
// meta
nacosVersion = '2.2.4'
}

dependencies {
// versions managed by spring.dependency-management
implementation 'org.springframework.boot:spring-boot-starter-web'
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'

// utility
implementation "org.apache.commons:commons-lang3:${commonsLang3Version}"
implementation("com.alibaba.fastjson2:fastjson2:${fastjsonVersion}")
// swagger
implementation "org.springdoc:springdoc-openapi-ui:${springdocVersion}"
implementation "org.springdoc:springdoc-openapi-javadoc:${springdocVersion}"
annotationProcessor 'com.github.therapi:therapi-runtime-javadoc-scribe:0.15.0'
// unit test
testImplementation("org.mockito:mockito-core:${mockitoVersion}")
// meta
implementation("com.alibaba.nacos:nacos-client:${nacosVersion}")
}

tasks.named('test') {
useJUnitPlatform()
}
22 changes: 22 additions & 0 deletions eventmesh-console/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# 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.
#

FROM openjdk:8-jre-alpine
VOLUME /tmp
COPY build/libs/eventmesh-console-*.jar eventmesh-console.jar
ENV JAVA_OPTS=""
ENTRYPOINT ["sh", "-c", "java $JAVA_OPTS -jar /eventmesh-console.jar"]
1 change: 1 addition & 0 deletions eventmesh-console/docs/UserGuide_CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// TODO
1 change: 1 addition & 0 deletions eventmesh-console/docs/UserGuide_EN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// TODO
Binary file not shown.
24 changes: 24 additions & 0 deletions eventmesh-console/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#
# 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.
#

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit b6f9ca5

Please sign in to comment.