Skip to content

Commit a1ec1bc

Browse files
committed
docs: 1.2.0 版本发布
1 parent 6c6a46e commit a1ec1bc

9 files changed

+102
-23
lines changed

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
version: "2"
22
services:
33
redis:
4-
container_name: redis
4+
container_name: redis-for-mqttx
55
image: redis
66
mqttx:
77
container_name: mqttx
8-
image: fantasywujun/mqttx
8+
image: fantasywujun/mqttx:1.2.0
99
ports:
1010
- 1883:1883
1111
- 8083:8083

dockerfile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
FROM openjdk:8-jdk-alpine AS builder
2-
WORKDIR target/dependency
3-
ARG APPJAR=target/*.jar
4-
COPY ${APPJAR} app.jar
1+
FROM openjdk:17.0.1
2+
WORKDIR /mqttx
3+
ARG EXECUTABLE_JAR=target/*.jar
4+
COPY ${EXECUTABLE_JAR} app.jar
5+
COPY target/classes/*.yml ./
6+
COPY src/main/resources/logback-spring.xml ./
57

6-
ENTRYPOINT ["java","-jar","-Xms1g","-Xmx1g","app.jar"]
8+
ENTRYPOINT ["java", "-jar", "app.jar", "--spring.config.location=/mqttx/"]

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</parent>
1111
<groupId>com.jun</groupId>
1212
<artifactId>mqttx</artifactId>
13-
<version>1.2.0-SNAPSHOT</version>
13+
<version>1.2.0</version>
1414
<name>mqttx</name>
1515
<description>mqtt broker</description>
1616

readme.md

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343

4444
`Mqttx` 基于 [MQTT v3.1.1](http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html) 协议开发,旨在提供 ***易于使用******性能优越*****mqtt broker**
4545

46+
注意:分支 `v1.2` 要求 ***JDK17***, 其它分支要求 ***JDK8***
47+
4648
### 1.1 快速开始
4749

4850
> 想通过 docker 快速体验?见 [docker 启动](#3-docker-启动)
@@ -137,12 +139,34 @@
137139

138140
## 3 docker 启动
139141

140-
> 镜像已上传至 docker-hub , 点击访问[fantasywujun/mqttx - Docker Hub](https://hub.docker.com/r/fantasywujun/mqttx)
142+
镜像已上传至 **docker-hub** , 访问[fantasywujun/mqttx - Docker Hub](https://hub.docker.com/r/fantasywujun/mqttx) 全部镜像
141143

142-
docker 环境安装好后,执行`docker-compose -f ./docker-compose.yml up` 启动, 效果见下图:
144+
docker 环境安装好后,执行 `docker-compose -f ./docker-compose.yml up` 启动, 效果见下图:
143145

144146
![y3R3tI.md.png](https://s3.ax1x.com/2021/02/04/y3R3tI.md.png)
145147

148+
| Docker Pull Command | 说明 |
149+
| -------------------------------------- | -------------------------------------- |
150+
| `docker pull fantasywujun/mqttx:1.2.0` | 基于 `jdk17.0.1``mqttx:1.2.0` 版本 |
151+
152+
**docker-compose** 文件内容:
153+
154+
```yaml
155+
version: "2"
156+
services:
157+
redis:
158+
container_name: redis-for-mqttx
159+
image: redis
160+
mqttx:
161+
container_name: mqttx
162+
image: fantasywujun/mqttx:1.2.0
163+
ports:
164+
- 1883:1883
165+
- 8083:8083
166+
```
167+
168+
169+
146170
## 4 功能说明
147171
148172
#### 4.1 qos 支持
@@ -415,7 +439,7 @@ mqttx:
415439

416440
#### 4.12 基础认证支持
417441

418-
升级至 **JDK17** 后,`mqttx` 提供基础客户端认证服务。
442+
`mqttx` 提供基础客户端认证服务。
419443

420444
配置项:
421445

@@ -458,8 +482,6 @@ Content-Length: 91
458482

459483
注意:
460484

461-
- **该功能仅 `v1.2` 分支版本支持**
462-
463485
- 接口返回 `http status = 200` 即表明**认证成功**, 其它状态值一律为**认证失败**
464486

465487

@@ -468,6 +490,8 @@ Content-Length: 91
468490

469491
1. `v1.0` 版本分支将作为支持 **mqttv3.1.1** 协议版本持续迭代
470492

493+
一旦 [OpenJDK: Loom (java.net)](http://openjdk.java.net/projects/loom/) release,`v1.0` 版本将不再维护,替代版本为 `v1.2`
494+
471495
2. 为使 ***mqttx*** 项目变得更好,请使用及学习该项目的同学主动反馈使用情况给我(提 issue 或加群反馈)
472496

473497
3. 后续工作
@@ -477,16 +501,13 @@ Content-Length: 91
477501
- [x] `v1.2.0.RELEASE` 版本开发
478502
- [ ] `v2.0.0.RELEASE` 版本开发
479503
- [x] bug 修复
480-
504+
481505
4. `v1.2` 版本由 **JDK8** 升级至 **JDK17**
482506

483507
5. `v2.0` 版本分支将作为 **mqttv5** 协议版本开始迭代
484508

485509
6. 这段时间工作任务繁重,功能迭代暂时停止,当然 **bug** 我还是会优先处理🙂
486510

487-
7. 请作者喝杯 **caffee** 😊
488-
6. 这段时间工作任务繁重,功能迭代暂时停止,当然 **bug** 我还是会优先处理🙂
489-
490511
7. 请作者喝杯 **丝绒拿铁** 😊
491512

492513
<img src="https://z3.ax1x.com/2021/07/15/Wm53vj.jpg" alt="coffee" height="300" />

src/main/resources/application-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
spring:
44
redis:
5-
host: localhost
5+
host: redis-for-mqttx
66

77
mqttx:
88
web-socket:
Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,18 @@
1-
# 生产环境配置文件
1+
# 开发环境配置文件
2+
3+
spring:
4+
redis:
5+
host: redis-for-mqttx
6+
7+
mqttx:
8+
web-socket:
9+
enable: true
10+
sys-topic:
11+
enable: true
12+
13+
logging:
14+
level:
15+
root: info
16+
file:
17+
path: /mqttx/logs
18+
config: /mqttx/logback-spring.xml

src/main/resources/application.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,4 @@ mqttx:
1212
# broker-id 用于区分集群内部机器,不同的 broker 必须分配不同的 id
1313
broker-id: @broker.id@
1414
# kryo 比 json 更具优势
15-
serialize-strategy: kryo
16-
auth:
17-
url: "http://localhost:8080/auth"
15+
serialize-strategy: kryo

src/main/resources/banner.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
|_| |_| |_|\__, |\__|\__/_/\_\
77
| |
88
|_|
9-
:: mqttx :: (v1.0.7.RELEASE)
9+
:: mqttx :: (1.2.0)

src/main/resources/logback-spring.xml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<configuration scan="true" scanPeriod="60 seconds" debug="false">
3+
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
4+
<springProperty scope="context" name="springAppName" source="spring.application.name"/>
5+
<springProperty scope="context" name="logLevel" source="logging.level.root"/>
6+
<springProperty scope="context" name="logPath" source="logging.file.path"/>
7+
8+
<property name="CONSOLE_LOG_PATTERN"
9+
value="%d{yyyy-MM-dd HH:mm:ss.SSS} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} --- [%t] [%L] %clr(%-40.40logger{39}){cyan} : %m%n"/>
10+
<property name="FILE_LOG_PATTERN"
11+
value="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p ${PID:- } --- [%t] [%L] %-40.40logger{39} : %m%n"/>
12+
13+
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
14+
<encoder>
15+
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
16+
<charset>UTF-8</charset>
17+
</encoder>
18+
</appender>
19+
20+
<root level="${logLevel}" additivity="false">
21+
<appender-ref ref="CONSOLE"/>
22+
</root>
23+
24+
<appender name="ROLLING" class="ch.qos.logback.core.rolling.RollingFileAppender">
25+
<file>${logPath}/${springAppName}.log</file>
26+
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
27+
<fileNamePattern>${logPath}/${springAppName}.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
28+
<maxHistory>7</maxHistory>
29+
<maxFileSize>100MB</maxFileSize>
30+
<totalSizeCap>3GB</totalSizeCap>
31+
</rollingPolicy>
32+
<encoder>
33+
<pattern>${FILE_LOG_PATTERN}</pattern>
34+
<charset>UTF-8</charset>
35+
</encoder>
36+
</appender>
37+
38+
<root level="${logLevel}" additivity="false">
39+
<appender-ref ref="ROLLING"/>
40+
</root>
41+
</configuration>

0 commit comments

Comments
 (0)