Skip to content

Commit

Permalink
docs: 1.2.0 版本发布
Browse files Browse the repository at this point in the history
  • Loading branch information
Amazingwujun committed Nov 23, 2021
1 parent 6c6a46e commit a1ec1bc
Show file tree
Hide file tree
Showing 9 changed files with 102 additions and 23 deletions.
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
version: "2"
services:
redis:
container_name: redis
container_name: redis-for-mqttx
image: redis
mqttx:
container_name: mqttx
image: fantasywujun/mqttx
image: fantasywujun/mqttx:1.2.0
ports:
- 1883:1883
- 8083:8083
12 changes: 7 additions & 5 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
FROM openjdk:8-jdk-alpine AS builder
WORKDIR target/dependency
ARG APPJAR=target/*.jar
COPY ${APPJAR} app.jar
FROM openjdk:17.0.1
WORKDIR /mqttx
ARG EXECUTABLE_JAR=target/*.jar
COPY ${EXECUTABLE_JAR} app.jar
COPY target/classes/*.yml ./
COPY src/main/resources/logback-spring.xml ./

ENTRYPOINT ["java","-jar","-Xms1g","-Xmx1g","app.jar"]
ENTRYPOINT ["java", "-jar", "app.jar", "--spring.config.location=/mqttx/"]
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>
<groupId>com.jun</groupId>
<artifactId>mqttx</artifactId>
<version>1.2.0-SNAPSHOT</version>
<version>1.2.0</version>
<name>mqttx</name>
<description>mqtt broker</description>

Expand Down
39 changes: 30 additions & 9 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@

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

注意:分支 `v1.2` 要求 ***JDK17***, 其它分支要求 ***JDK8***

### 1.1 快速开始

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

## 3 docker 启动

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

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

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

| Docker Pull Command | 说明 |
| -------------------------------------- | -------------------------------------- |
| `docker pull fantasywujun/mqttx:1.2.0` | 基于 `jdk17.0.1``mqttx:1.2.0` 版本 |

**docker-compose** 文件内容:

```yaml
version: "2"
services:
redis:
container_name: redis-for-mqttx
image: redis
mqttx:
container_name: mqttx
image: fantasywujun/mqttx:1.2.0
ports:
- 1883:1883
- 8083:8083
```
## 4 功能说明
#### 4.1 qos 支持
Expand Down Expand Up @@ -415,7 +439,7 @@ mqttx:

#### 4.12 基础认证支持

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

配置项:

Expand Down Expand Up @@ -458,8 +482,6 @@ Content-Length: 91

注意:

- **该功能仅 `v1.2` 分支版本支持**

- 接口返回 `http status = 200` 即表明**认证成功**, 其它状态值一律为**认证失败**


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

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

一旦 [OpenJDK: Loom (java.net)](http://openjdk.java.net/projects/loom/) release,`v1.0` 版本将不再维护,替代版本为 `v1.2`

2. 为使 ***mqttx*** 项目变得更好,请使用及学习该项目的同学主动反馈使用情况给我(提 issue 或加群反馈)

3. 后续工作
Expand All @@ -477,16 +501,13 @@ Content-Length: 91
- [x] `v1.2.0.RELEASE` 版本开发
- [ ] `v2.0.0.RELEASE` 版本开发
- [x] bug 修复

4. `v1.2` 版本由 **JDK8** 升级至 **JDK17**

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

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

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

7. 请作者喝杯 **丝绒拿铁** 😊

<img src="https://z3.ax1x.com/2021/07/15/Wm53vj.jpg" alt="coffee" height="300" />
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

spring:
redis:
host: localhost
host: redis-for-mqttx

mqttx:
web-socket:
Expand Down
19 changes: 18 additions & 1 deletion src/main/resources/application-prod.yml
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
# 生产环境配置文件
# 开发环境配置文件

spring:
redis:
host: redis-for-mqttx

mqttx:
web-socket:
enable: true
sys-topic:
enable: true

logging:
level:
root: info
file:
path: /mqttx/logs
config: /mqttx/logback-spring.xml
4 changes: 1 addition & 3 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,4 @@ mqttx:
# broker-id 用于区分集群内部机器,不同的 broker 必须分配不同的 id
broker-id: @broker.id@
# kryo 比 json 更具优势
serialize-strategy: kryo
auth:
url: "http://localhost:8080/auth"
serialize-strategy: kryo
2 changes: 1 addition & 1 deletion src/main/resources/banner.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
|_| |_| |_|\__, |\__|\__/_/\_\
| |
|_|
:: mqttx :: (v1.0.7.RELEASE)
:: mqttx :: (1.2.0)
41 changes: 41 additions & 0 deletions src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="60 seconds" debug="false">
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
<springProperty scope="context" name="springAppName" source="spring.application.name"/>
<springProperty scope="context" name="logLevel" source="logging.level.root"/>
<springProperty scope="context" name="logPath" source="logging.file.path"/>

<property name="CONSOLE_LOG_PATTERN"
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"/>
<property name="FILE_LOG_PATTERN"
value="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p ${PID:- } --- [%t] [%L] %-40.40logger{39} : %m%n"/>

<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
<charset>UTF-8</charset>
</encoder>
</appender>

<root level="${logLevel}" additivity="false">
<appender-ref ref="CONSOLE"/>
</root>

<appender name="ROLLING" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${logPath}/${springAppName}.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${logPath}/${springAppName}.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<maxHistory>7</maxHistory>
<maxFileSize>100MB</maxFileSize>
<totalSizeCap>3GB</totalSizeCap>
</rollingPolicy>
<encoder>
<pattern>${FILE_LOG_PATTERN}</pattern>
<charset>UTF-8</charset>
</encoder>
</appender>

<root level="${logLevel}" additivity="false">
<appender-ref ref="ROLLING"/>
</root>
</configuration>

0 comments on commit a1ec1bc

Please sign in to comment.