Skip to content

Commit

Permalink
Merge pull request #40 from libxengine/develop
Browse files Browse the repository at this point in the history
V3.12.0.1001 Merge
  • Loading branch information
xengine-qyt authored Sep 19, 2024
2 parents 0595f2f + 4adfa5b commit dfc89bd
Show file tree
Hide file tree
Showing 31 changed files with 417 additions and 159 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/linuxbuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: ubuntu build workflows

on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]

permissions:
contents: read

jobs:
build:
strategy:
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
- os: ubuntu-24.04
runs-on: ${{ matrix.os }}

steps:
# 检出您的主仓库代码
- name: Checkout main repository code
uses: actions/checkout@v4
with:
ref: 'develop'

# 检出依赖的xengine仓库到指定的xengine目录
- name: Checkout dependency repository (xengine)
uses: actions/checkout@v4
with:
repository: libxengine/libxengine
path: libxengine

- name: sub module checkout (opensource)
run: |
git submodule init
git submodule update
# 设置依赖库的环境变量
- name: Set up Dependency Environment Variables
run: |
cd libxengine
chmod 777 *
sudo ./XEngine_LINEnv.sh -i 3
cd ..
#编译
- name: make
run: |
cd XEngine_Source
make
make FLAGS=InstallAll
make FLAGS=CleanAll
make RELEASE=1
make FLAGS=InstallAll
make FLAGS=CleanAll
cd ..
- name: test
run: |
cd XEngine_Release
./XEngine_MQServiceApp -t
64 changes: 64 additions & 0 deletions .github/workflows/macbuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: macos build workflows

on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]

permissions:
contents: read

jobs:
build:
strategy:
matrix:
include:
- os: macos-13
runs-on: ${{ matrix.os }}

steps:
- name: Checkout main repository code
uses: actions/checkout@v4
with:
ref: 'develop'

# 检出依赖的xengine仓库到指定的xengine目录
- name: Checkout dependency repository (xengine)
uses: actions/checkout@v4
with:
repository: libxengine/libxengine
path: libxengine

- name: sub module checkout (opensource)
run: |
git submodule init
git submodule update
- name: brew install
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# 设置依赖库的环境变量
- name: Set up Dependency Environment Variables
run: |
cd libxengine
chmod 777 *
./XEngine_LINEnv.sh -i 3
cd ..
#编译
- name: make debug
run: |
cd XEngine_Source
make PLATFORM=mac
make PLATFORM=mac FLAGS=InstallAll
make PLATFORM=mac FLAGS=CleanAll
- name: make release
run: |
cd XEngine_Source
make PLATFORM=mac RELEASE=1
make PLATFORM=mac FLAGS=InstallAll
make PLATFORM=mac FLAGS=CleanAll
- name: test
run: |
cd XEngine_Release
./XEngine_MQServiceApp -t
77 changes: 77 additions & 0 deletions .github/workflows/msbuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: windows build workflows

on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]

permissions:
contents: read

jobs:
build:
strategy:
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
fail-fast: false
matrix:
configuration: [Debug ,Release]
platform: [x86 ,x64]

runs-on: windows-latest # 最新的 Windows 环境

steps:
# 检出您的主仓库代码
- name: Checkout main repository code
uses: actions/checkout@v4
with:
ref: 'develop'

# 检出依赖的xengine仓库到指定的xengine目录
- name: Checkout dependency repository (xengine)
uses: actions/checkout@v4
with:
repository: libxengine/libxengine
path: xengine

- name: sub module checkout (opensource)
run: |
git submodule init
git submodule update
shell: pwsh

# 设置依赖库的环境变量
- name: Set up Dependency Environment Variables
run: |
echo "XENGINE_INCLUDE=${{ github.workspace }}/xengine" | Out-File -FilePath $env:GITHUB_ENV -Append
echo "XENGINE_LIB32=${{ github.workspace }}/xengine/XEngine_Windows/x86" | Out-File -FilePath $env:GITHUB_ENV -Append
echo "XENGINE_LIB64=${{ github.workspace }}/xengine/XEngine_Windows/x64" | Out-File -FilePath $env:GITHUB_ENV -Append
shell: pwsh

# 配置 MSBuild 的路径,准备构建 VC++ 项目
- name: Setup MSBuild
uses: microsoft/[email protected]
#编译
- name: Build Solution
run: msbuild XEngine_Source/XEngine_MQServiceApp.sln /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }}
#测试
- name: Conditional Step for x86 Release
if: matrix.configuration == 'Release' && matrix.platform == 'x86'
run: |
cp -r XEngine_Source/Release/*.dll XEngine_Release/
cp -r XEngine_Source/Release/*.exe XEngine_Release/
cp -r XEngine_Source/VSCopy-x86.bat XEngine_Release/
cd XEngine_Release
./VSCopy-x86.bat
./XEngine_MQServiceApp.exe -t
shell: pwsh
- name: Conditional Step for x86 Debug
if: matrix.configuration == 'Debug' && matrix.platform == 'x86'
run: |
cp -r XEngine_Source/Debug/*.dll XEngine_Release/
cp -r XEngine_Source/Debug/*.exe XEngine_Release/
cp -r XEngine_Source/VSCopy-x86.bat XEngine_Release/
cd XEngine_Release
./VSCopy-x86.bat
./XEngine_MQServiceApp.exe -t
shell: pwsh
20 changes: 20 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
XEngine_MQService V3.12.0.1001

增加:编译CI工作流支持
增加:注册绑定公用消息
增加:服务启动测试参数
增加:MQTT消息发布的支持
修正:MQTT没有日志输出
修正:WEBSOCKET不支持关闭和PING协议的问题
修正:DBModule_MQUser_KeyList用户参数为NULL的问题
修正:指定用户发送数据的问题

added:build ci workflows supported
added:register bind comm topic
added:start test parameter
added:mqtt message publish support
fixed:log not print for mqtt
fixed:close and ping protocol support for websocket protocol
fixed:DBModule_MQUser_KeyList user parameter is null incorrect
fixed:The problem of specifying invalid sending user
======================================================================================
XEngine_MQService V3.11.0.1001

增加:MQTT协议服务支持
Expand Down
6 changes: 3 additions & 3 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ this software support following features

#### XEngine Evn
you must install XEngine,need V8.31 or above,install XEngine can be refer to xengine Readme docment
GITEE:https://gitee.com/xyry/libxengine
GITHUB:https://github.com/libxengine/xengine
GITEE:https://gitee.com/libxengine/libxengine
GITHUB:https://github.com/libxengine/libxengine

##### fast to deployment
git clone https://gitee.com/xyry/libxengine.git or git clone https://github.com/libxengine/xengine.git
git clone https://gitee.com/libxengine/libxengine.git or git clone https://github.com/libxengine/libxengine.git
window Exection XEngine_WINEnv.bat
Linux Exection:sudo ./XEngine_LINEnv.sh -i 3
Macos Exection:./XEngine_LINEnv.sh -i 3
Expand Down
27 changes: 5 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ c c++Message Service

#### XEngine环境
必须安装XEngine,版本需要V8.31或者以上版本,安装XEngine可以参考其Readme文档
GITEE:https://gitee.com/xyry/libxengine
GITHUB:https://github.com/libxengine/xengine
GITEE:https://gitee.com/libxengine/libxengine
GITHUB:https://github.com/libxengine/libxengine

##### 快速部署
git clone https://gitee.com/xyry/libxengine.git 或者 git clone https://github.com/libxengine/xengine.git
git clone https://gitee.com/libxengine/libxengine.git 或者 git clone https://github.com/libxengine/libxengine.git
window执行XEngine_WINEnv.bat 脚本.
Linux执行:sudo ./XEngine_LINEnv.sh -i 3
macos执行:./XEngine_LINEnv.sh -i 3
Expand All @@ -53,7 +53,8 @@ macos执行:./XEngine_LINEnv.sh -i 3
#### sub module
由于依赖的子模块,在你checkout仓库后,在仓库目录下执行下面的命令拉取子模块
git submodule init
git submodule update
git submodule update
如果github访问失败,你也可以clone该项目,在主目录下使用命令:git clone https://gitee.com/xengine/XEngine_OPenSource.git XEngine_Source/XEngine_Depend

#### Windows
使用VS打开并且编译,支持WINDOWS 7SP1以上系统
Expand Down Expand Up @@ -122,24 +123,6 @@ make FLAGS=CleanAll 清理编译
## 关注我们
如果你觉得这个软件对你有帮助,请你给我们一个START吧

## 开发计划
扩展获取消息的内容
数据库缓存功能
用户消息
完善消息属性生效
公众号和小程序
QOS(支持强回复确认)
功能开关
MQTT支持
支持时区设置
完善消息订阅(永存)
完善HTTP_CALL
高性能内存队列
扩充HTTP管理接口
消息变量,支持消息变量设置
序列号重置与优化
完善公用KEY的使用

## 提交问题

如果你有问题,可以在issues中提交
16 changes: 9 additions & 7 deletions XEngine_Apps/MQCore_TCPApp/MQCore_TCPApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ using namespace std;

XSOCKET m_Socket;
__int64x nLastNumber = 0;
LPCXSTR lpszKey = _X("XEngine_NotifyKey"); //主题
LPCXSTR lpszKey = _X("XEngine_CommKey"); //主题
LPCXSTR lpszUser = _X("aaadddzxc");
LPCXSTR lpszPass = _X("123123");

void MQ_Register()
{
Expand All @@ -48,8 +50,8 @@ void MQ_Register()
st_ProtocolInfo.nUserState = 0;
st_ProtocolInfo.nPhoneNumber = 13699999999;
st_ProtocolInfo.nIDNumber = 511000000000101010;
strcpy(st_ProtocolInfo.tszUserName, "123123aa");
strcpy(st_ProtocolInfo.tszUserPass, "123123");
strcpy(st_ProtocolInfo.tszUserName, lpszUser);
strcpy(st_ProtocolInfo.tszUserPass, lpszPass);
strcpy(st_ProtocolInfo.tszEMailAddr, "[email protected]");

st_ProtocolHdr.unPacketSize = sizeof(XENGINE_PROTOCOL_USERINFO);
Expand Down Expand Up @@ -95,8 +97,8 @@ void MQ_Authorize()
st_ProtocolHdr.byIsReply = true; //获得处理返回结果
st_ProtocolHdr.wTail = XENGIEN_COMMUNICATION_PACKET_PROTOCOL_TAIL;

strcpy(st_ProtocolAuth.tszUserName, "123123aa");
strcpy(st_ProtocolAuth.tszUserPass, "123123");
strcpy(st_ProtocolAuth.tszUserName, lpszUser);
strcpy(st_ProtocolAuth.tszUserPass, lpszPass);

st_ProtocolHdr.unPacketSize = sizeof(XENGINE_PROTOCOL_USERAUTH);

Expand Down Expand Up @@ -199,8 +201,8 @@ void MQ_DeleteUser()
st_ProtocolInfo.nUserState = 0;
st_ProtocolInfo.nPhoneNumber = 13699999999;
st_ProtocolInfo.nIDNumber = 511000000000101010;
strcpy(st_ProtocolInfo.tszUserName, "123123aa");
strcpy(st_ProtocolInfo.tszUserPass, "123123");
strcpy(st_ProtocolInfo.tszUserName, lpszUser);
strcpy(st_ProtocolInfo.tszUserPass, lpszPass);
strcpy(st_ProtocolInfo.tszEMailAddr, "[email protected]");

nLen = sizeof(XENGINE_PROTOCOLHDR) + st_ProtocolHdr.unPacketSize;
Expand Down
Binary file modified XEngine_Docment/Docment_en.docx
Binary file not shown.
Binary file modified XEngine_Docment/Docment_zh.docx
Binary file not shown.
11 changes: 6 additions & 5 deletions XEngine_Release/XEngine_Config/XEngine_DBConfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"MQUser":{
"UserTime":{
"bPubClear":false
"MQUser": {
"UserTime": {
"bPubClear": false
}
},
"MQData":{
"nDBMonth":3
"MQData": {
"bCommSub": true,
"nDBMonth": 3
}
}
1 change: 1 addition & 0 deletions XEngine_Release/XEngine_Config/XEngine_VerConfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"XVer":[
"3.12.0.1001 Build20240919",
"3.11.0.1001 Build20240517",
"3.10.0.1001 Build20240305",
"3.9.0.1001 Build20231227",
Expand Down
1 change: 1 addition & 0 deletions XEngine_Source/MQCore_ConfigModule/Config_Define.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ typedef struct
struct
{
int nDBMonth;
bool bCommSub;
}st_MQData;
}MESSAGEQUEUE_DBCONFIG;
//////////////////////////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,14 @@ bool CConfig_Json::Config_Json_DBFile(LPCXSTR lpszConfigFile, MESSAGEQUEUE_DBCON
Json::Value st_JsonUserTime = st_JsonUser["UserTime"];
pSt_DBConfig->st_MQUser.st_UserTime.bPubClear = st_JsonUserTime["bPubClear"].asBool();

if (st_JsonRoot["MQData"].empty() || (1 != st_JsonRoot["MQData"].size()))
if (st_JsonRoot["MQData"].empty() || (2 != st_JsonRoot["MQData"].size()))
{
Config_IsErrorOccur = true;
Config_dwErrorCode = ERROR_MQ_MODULE_CONFIG_JSON_XTIME;
return false;
}
Json::Value st_JsonMQData = st_JsonRoot["MQData"];
pSt_DBConfig->st_MQData.nDBMonth = st_JsonMQData["nDBMonth"].asInt();
pSt_DBConfig->st_MQData.bCommSub = st_JsonMQData["bCommSub"].asBool();
return true;
}
Loading

0 comments on commit dfc89bd

Please sign in to comment.