Refactor the server module (#817)

pull/823/head
chen.ma 2 years ago
parent 91d37b21fa
commit 946e7eaa00

@ -33,10 +33,10 @@ hippo4j/hippo4j-server
方式一:
```shell
# 进入到 hippo4j-server 工程路径下
# 进入到 hippo4j-server/hippo4j-bootstrap 工程路径下
mvn clean package -Dskip.spotless.apply=true
# 默认打包是打包的 tag 是 latest
docker build -t hippo4j/hippo4j-server ../hippo4j-server
docker build -t hippo4j/hippo4j-server ../hippo4j-bootstrap
```
方式二:

@ -1,40 +1 @@
---
sidebar_position: 3
---
# 快速开始
## 服务启动
使用 Docker 运行服务端,默认使用内置 H2 数据库,数据持久化到 Docker 容器存储卷中。
```shell
docker run -d -p 6691:6691 --name hippo4j-server hippo4j/hippo4j-server
```
> 如果没有 Docker可以使用源码编译的方式启动 [Hippo4J-Server](https://github.com/longtai-cn/hippo4j/tree/develop/hippo4j-server) 模块下 ServerApplication 应用类。
启动示例项目,[hippo4j-spring-boot-starter-example](https://github.com/opengoofy/hippo4j/tree/develop/hippo4j-example/hippo4j-spring-boot-starter-example) 模块下 Hippo4JServerExampleApplication 应用类。
访问 Server 控制台,路径 `http://localhost:6691/index.html`默认用户名密码admin / 123456
## 配置变更
访问控制台动态线程池菜单下线程池实例,修改动态线程池相关参数。
![](https://images-machen.oss-cn-beijing.aliyuncs.com/image-20220813173811668.png)
观察 Hippo4j-Example 控制台日志输出,日志输出包括不限于此信息即为成功。
```tex
2022-09-10 00:23:29.783 INFO 50322 --- [change.config_0] c.h.s.s.c.ServerThreadPoolDynamicRefresh : [message-consume] Dynamic thread pool change parameter.
corePoolSize: 2 => 4
maximumPoolSize: 6 => 12
capacity: 1024 => 2048
keepAliveTime: 9999 => 9999
executeTimeOut: 800 => 3000
rejectedType: SyncPutQueuePolicy => RunsOldestTaskPolicy
allowCoreThreadTimeOut: true => true
```
另外,当 Client 集群部署时,可以修改某一个实例,或选择 `全部修改` 按钮,修改所有实例线程池信息。
--- sidebar_position: 3 --- # 快速开始 ## 服务启动 使用 Docker 运行服务端,默认使用内置 H2 数据库,数据持久化到 Docker 容器存储卷中。 ```shell docker run -d -p 6691:6691 --name hippo4j-server hippo4j/hippo4j-server ``` > 如果没有 Docker可以使用源码编译的方式启动 [Hippo4J-Server/Hippo4J-Bootstrap](https://github.com/longtai-cn/hippo4j/tree/develop/hippo4j-server/hippo4j-bootstrap) 模块下 ServerApplication 应用类。 启动示例项目,[hippo4j-spring-boot-starter-example](https://github.com/opengoofy/hippo4j/tree/develop/hippo4j-example/hippo4j-spring-boot-starter-example) 模块下 Hippo4JServerExampleApplication 应用类。 访问 Server 控制台,路径 `http://localhost:6691/index.html`默认用户名密码admin / 123456 ## 配置变更 访问控制台动态线程池菜单下线程池实例,修改动态线程池相关参数。 ![](https://images-machen.oss-cn-beijing.aliyuncs.com/image-20220813173811668.png) 观察 Hippo4j-Example 控制台日志输出,日志输出包括不限于此信息即为成功。 ```tex 2022-09-10 00:23:29.783 INFO 50322 --- [change.config_0] c.h.s.s.c.ServerThreadPoolDynamicRefresh : [message-consume] Dynamic thread pool change parameter. corePoolSize: 2 => 4 maximumPoolSize: 6 => 12 capacity: 1024 => 2048 keepAliveTime: 9999 => 9999 executeTimeOut: 800 => 3000 rejectedType: SyncPutQueuePolicy => RunsOldestTaskPolicy allowCoreThreadTimeOut: true => true ``` 另外,当 Client 集群部署时,可以修改某一个实例,或选择 `全部修改` 按钮,修改所有实例线程池信息。

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.hippo4j</groupId>
<artifactId>hippo4j-all</artifactId>
<artifactId>hippo4j-server</artifactId>
<version>${revision}</version>
</parent>
<artifactId>hippo4j-auth</artifactId>

@ -9,6 +9,10 @@
</parent>
<artifactId>hippo4j-bootstrap</artifactId>
<properties>
<maven.deploy.skip>true</maven.deploy.skip>
</properties>
<dependencies>
<dependency>
<groupId>cn.hippo4j</groupId>
@ -38,4 +42,37 @@
</dependency>
<!-- Adapter end -->
</dependencies>
<build>
<finalName>hippo4j-server</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>1.2.2</version>
<configuration>
<imageName>hippo4j-server:${project.version}</imageName>
<dockerDirectory>${project.basedir}</dockerDirectory>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
</configuration>
</plugin>
</plugins>
</build>
</project>

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.hippo4j</groupId>
<artifactId>hippo4j-all</artifactId>
<artifactId>hippo4j-server</artifactId>
<version>${revision}</version>
</parent>
<artifactId>hippo4j-config</artifactId>

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.hippo4j</groupId>
<artifactId>hippo4j-all</artifactId>
<artifactId>hippo4j-server</artifactId>
<version>${revision}</version>
</parent>
<artifactId>hippo4j-console</artifactId>

File diff suppressed because one or more lines are too long

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.hippo4j</groupId>
<artifactId>hippo4j-all</artifactId>
<artifactId>hippo4j-server</artifactId>
<version>${revision}</version>
</parent>
<artifactId>hippo4j-discovery</artifactId>

@ -8,71 +8,17 @@
<version>${revision}</version>
</parent>
<artifactId>hippo4j-server</artifactId>
<packaging>pom</packaging>
<properties>
<maven.deploy.skip>true</maven.deploy.skip>
</properties>
<dependencies>
<dependency>
<groupId>cn.hippo4j</groupId>
<artifactId>hippo4j-console</artifactId>
<version>${revision}</version>
</dependency>
<!-- Adapter start -->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
</dependency>
<!-- Adapter end -->
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>1.2.2</version>
<configuration>
<imageName>${project.artifactId}:${project.version}</imageName>
<dockerDirectory>${project.basedir}</dockerDirectory>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
</configuration>
</plugin>
</plugins>
</build>
<modules>
<module>hippo4j-auth</module>
<module>hippo4j-bootstrap</module>
<module>hippo4j-config</module>
<module>hippo4j-console</module>
<module>hippo4j-discovery</module>
</modules>
</project>

@ -38,12 +38,8 @@
<modules>
<module>hippo4j-adapter</module>
<module>hippo4j-auth</module>
<module>hippo4j-common</module>
<module>hippo4j-config</module>
<module>hippo4j-console</module>
<module>hippo4j-core</module>
<module>hippo4j-discovery</module>
<module>hippo4j-example</module>
<module>hippo4j-message</module>
<module>hippo4j-monitor</module>

Loading…
Cancel
Save