Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
1db0e92
ci:fixed rocky build name
xengine-qyt Oct 22, 2025
8788c21
update:depend library
xengine-qyt Nov 4, 2025
a30e760
update:depend library
xengine-qyt Feb 9, 2026
59f513d
modify:does not case-sensitive
xengine-qyt Feb 9, 2026
51fce30
update:tcp app example
xengine-qyt Feb 9, 2026
8dac180
added:data transfer crypt
xengine-qyt Feb 9, 2026
8a47b4f
update:configure and make file
xengine-qyt Feb 9, 2026
a7322b9
modify:Reconstruct the TCP and HTTP protocols; now the data processed…
xengine-qyt Feb 9, 2026
f5ff11d
modify:message and topic modify and request message number to http pr…
xengine-qyt Feb 10, 2026
1fe6ec5
fixed:some protocol not reply and parse process failure
xengine-qyt Feb 10, 2026
b21d069
modify:unread message and bind and unbind protocol to http reply
xengine-qyt Feb 10, 2026
3d561b0
fixed:build error
xengine-qyt Feb 10, 2026
881514a
delete:http comm message packet
xengine-qyt Feb 26, 2026
acbd9a6
modify:bind message protocol string
xengine-qyt Feb 26, 2026
68fc148
fixed:http protocol not reply when not found protocol
xengine-qyt Feb 26, 2026
39ef1b7
delete:more protocol error define
xengine-qyt Feb 26, 2026
1f3fa6c
modify:protocol user unified
xengine-qyt Feb 27, 2026
3dbd410
added:permission control of build switch
xengine-qyt Feb 27, 2026
a0f6cf8
modify:example
xengine-qyt Feb 27, 2026
29cdf83
modify:create token of http when tcp login
xengine-qyt Feb 28, 2026
f95754b
update:readme and document
xengine-qyt Feb 28, 2026
cfd3827
update:CHANGELOG
xengine-qyt Feb 28, 2026
6c1d4ae
update:version configure
xengine-qyt Feb 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/Rocky_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,6 @@ jobs:
- name: Upload folder as artifact with CentOS
uses: actions/upload-artifact@v4
with:
name: XEngine_MQServiceApp-CentOS_${{ matrix.version }}_${{ matrix.artifact }}
name: XEngine_MQServiceApp-RockyLinux_${{ matrix.version }}_${{ matrix.artifact }}
path: XEngine_Release/
retention-days: 1
36 changes: 36 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
XEngine_MQService V3.19.0.1001

增加:权限控制开关
增加:数据传输加密支持
更新:依赖库
修改:mqtt协议的订阅和取消订阅不在交给tcp处理并且mqtt协议流程代码修改
修改:当tcp登录的时候会创建http的token了
修改:重构了tcp和http协议,现在大部分消息处理都通过http实现,tcp只处理投递订阅和获取消息
修改:绑定消息协议字符串
修改:协议消息统一
修改:权限控制和处理
修改:tcp登录权限处理
修正:某些时候协议没有响应和解析问题
修正:当post的协议找不到的时候没有响应问题
修正:当没有找到http协议的时候无响应问题
删除:http公用消息打包函数
删除:多余的协议错误定义

added:permission control of build switch
added:data transfer crypt
update:depend library
modify:mqtt protcol bind and unbind does not post tcp handle and mqtt protocol process modify
modify:create token of http when tcp login
modify:Reconstruct the TCP and HTTP protocols,now the data processed by the HTTP protocol is no longer handed over to the TCP for processing
modify:message and topic modify and request message number to http protocol
modify:does not case-sensitive
modify:bind message protocol string
modify:protocol user unified
modify:permission management and process
modify:tcp login permission handle
fixed:some protocol not reply and parse process failure
fixed:no reply when not found post protocol
fixed:http protocol not reply when not found protocol
delete:http comm message packet
delete:more protocol error define
======================================================================================
XEngine_MQService V3.18.0.1001

ci:增加CentOS和Alma以及debian13系统支持
Expand Down
5 changes: 4 additions & 1 deletion README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ this software support following features
3. message timeout
4. topic Partition
5. message tracking(planning)
6. encrypt Communication(planning)
6. encrypt Communication
7. load balanc(planning)
8. message get time
9. message subcribe
Expand All @@ -38,6 +38,7 @@ this software support following features
22. http verification
23. email notify
24. sms notify(plan)
25. permission control

## install

Expand Down Expand Up @@ -108,6 +109,8 @@ database you need to open the database matching fields and tables are consistent

## other problems
You can refer to the document under the docment directory. It contains API protocol and service description.
#### Compiler Options
When __XENGINE_MESSAGEQUEUE_BUILD_SWITCH_PERMISSION__ == 1, permission control can be enabled. Only users with administrator privileges can operate critical permissions, and this is mainly intended for HTTP interfaces

## Test Server Address
Address:app.xyry.org Port:TCP 5200,WEBSOCKET 5201,HTTP Management Interface 5202
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ c c++Message Service
3. 消息超时
4. 主题分区
5. 消息回溯
6. 加密通信(planning)
6. 加密通信
7. 负载均衡(planning)
8. 消息次数
9. 消息订阅
Expand All @@ -40,6 +40,7 @@ c c++Message Service
22. http验证
23. 电子邮件通知
24. 短信通知(plan)
25. 权限控制

## 安装教程

Expand Down Expand Up @@ -118,6 +119,9 @@ make FLAGS=CleanAll 清理编译
## 其他问题
你可以参考docment目录下的文档.里面包含了API协议和服务说明.

#### 编译选项
__XENGINE_MESSAGEQUEUE_BUILD_SWITCH_PERMISSION__ == 1 可以开启权限控制,只有管理员权限才可以操作关键权限,主要用于HTTP接口

## 测试服务器
地址:app.xyry.org 端口:TCP 5200,WEBSOCKET 5201,管理接口HTTP 5202

Expand Down
128 changes: 125 additions & 3 deletions XEngine_Apps/MQCore_HTTPApp/MQCore_HTTPApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,53 @@
//VS2022 Debug x86 Compile
//g++ -std=c++17 -Wall -g MQCore_HTTPApp.cpp -o MQCore_HTTPApp.exe -lXEngine_BaseLib -lXClient_APIHelp
__int64x xhToken = 0;

//获取未读消息
void MQ_GetUNRead()
{
LPCXSTR lpszPostUrl = _X("http://127.0.0.1:5202/api?function=unreadmsg");

Json::Value st_JsonRoot;
Json::Value st_JsonObject;

st_JsonObject["tszMQUsr"] = "123123aa";
st_JsonObject["tszMQKey"] = "XEngine_MSGKeyName";
st_JsonRoot["xhToken"] = xhToken;
st_JsonRoot["Object"] = st_JsonObject;

int nLen = 0;
XCHAR* ptszMsgBody = NULL;
if (!APIClient_Http_Request(_X("POST"), lpszPostUrl, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBody, &nLen))
{
_xtprintf("发送投递失败!\n");
return;
}
_xtprintf("MQ_GetUNRead:%s\n", ptszMsgBody);
BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBody);
}
void MQ_DelMsg()
{
LPCXSTR lpszPostUrl = _X("http://127.0.0.1:5202/api?function=deletemsg");

Json::Value st_JsonRoot;
Json::Value st_JsonObject;

st_JsonObject["nSerial"] = 1;
st_JsonObject["tszMQKey"] = "XEngine_MSGKeyName";
st_JsonRoot["xhToken"] = xhToken;
st_JsonRoot["Object"] = st_JsonObject;

int nLen = 0;
XCHAR* ptszMsgBody = NULL;
if (!APIClient_Http_Request(_X("POST"), lpszPostUrl, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBody, &nLen))
{
_xtprintf("发送投递失败!\n");
return;
}
_xtprintf("MQ_DelMsg:%s\n", ptszMsgBody);
BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBody);
}

void MQ_UserRegister()
{
LPCXSTR lpszPostUrl = _X("http://127.0.0.1:5202/api?function=register");
Expand Down Expand Up @@ -71,7 +118,7 @@ void MQ_UserLogin()
}
void MQ_UserDelete()
{
LPCXSTR lpszPostUrl = _X("http://127.0.0.1:5202/api?function=deluser");
LPCXSTR lpszPostUrl = _X("http://127.0.0.1:5202/api?function=deleteuser");

Json::Value st_JsonRoot;
Json::Value st_JsonUser;
Expand Down Expand Up @@ -132,7 +179,32 @@ void MQ_TopicCreate()
Json::Value st_JsonRoot;
Json::Value st_JsonObject;

st_JsonObject["name"] = "topictest";
st_JsonObject["tszMQUsr"] = "123123aa";
st_JsonObject["tszMQKey"] = "topictest";

st_JsonRoot["xhToken"] = xhToken;
st_JsonRoot["Object"] = st_JsonObject;

int nLen = 0;
XCHAR* ptszMsgBody = NULL;
if (!APIClient_Http_Request(_X("POST"), lpszPostUrl, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBody, &nLen))
{
_xtprintf("发送投递失败!\n");
return;
}
_xtprintf("MQ_TopicCreate:%s\n", ptszMsgBody);
BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBody);
}
void MQ_TopicModify()
{
LPCXSTR lpszPostUrl = _X("http://127.0.0.1:5202/api?function=modifytopic");

Json::Value st_JsonRoot;
Json::Value st_JsonObject;

st_JsonObject["tszMQUsr"] = "123123aa";
st_JsonObject["tszSrcTopic"] = "topictest";
st_JsonObject["tszDstTopic"] = "topic2test";

st_JsonRoot["xhToken"] = xhToken;
st_JsonRoot["Object"] = st_JsonObject;
Expand All @@ -147,14 +219,16 @@ void MQ_TopicCreate()
_xtprintf("MQ_TopicCreate:%s\n", ptszMsgBody);
BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBody);
}

void MQ_TopicDelete()
{
LPCXSTR lpszPostUrl = _X("http://127.0.0.1:5202/api?function=deletetopic");

Json::Value st_JsonRoot;
Json::Value st_JsonObject;

st_JsonObject["name"] = "topictest";
st_JsonObject["tszMQUsr"] = "123123aa";
st_JsonObject["tszMQKey"] = "topic2test";

st_JsonRoot["xhToken"] = xhToken;
st_JsonRoot["Object"] = st_JsonObject;
Expand All @@ -169,6 +243,49 @@ void MQ_TopicDelete()
_xtprintf("MQ_TopicDelete:%s\n", ptszMsgBody);
BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBody);
}
void MQ_GetTopic()
{
LPCXSTR lpszPostUrl = _X("http://127.0.0.1:5202/api?function=gettopic");

Json::Value st_JsonRoot;
Json::Value st_JsonObject;

st_JsonRoot["xhToken"] = xhToken;
st_JsonObject["tszMQKey"] = "topictest";
st_JsonRoot["Object"] = st_JsonObject;

int nLen = 0;
XCHAR* ptszMsgBody = NULL;
if (!APIClient_Http_Request(_X("POST"), lpszPostUrl, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBody, &nLen))
{
_xtprintf("发送投递失败!\n");
return;
}
_xtprintf("MQ_GetTopic:%s\n", ptszMsgBody);
BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBody);
}
void MQ_GetNumber()
{
LPCXSTR lpszPostUrl = _X("http://127.0.0.1:5202/api?function=getnumber");

Json::Value st_JsonRoot;
Json::Value st_JsonObject;

st_JsonObject["nKeepTime"] = 1;
st_JsonObject["tszMQKey"] = "XEngine_CommKey";
st_JsonRoot["xhToken"] = xhToken;
st_JsonRoot["Object"] = st_JsonObject;

int nLen = 0;
XCHAR* ptszMsgBody = NULL;
if (!APIClient_Http_Request(_X("POST"), lpszPostUrl, st_JsonRoot.toStyledString().c_str(), NULL, &ptszMsgBody, &nLen))
{
_xtprintf("发送投递失败!\n");
return;
}
_xtprintf("MQ_GetNumber:%s\n", ptszMsgBody);
BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBody);
}
void MQ_GetTopicList()
{
LPCXSTR lpszPostUrl = _X("http://127.0.0.1:5202/api?function=getlist");
Expand Down Expand Up @@ -196,12 +313,17 @@ int main()

MQ_UserRegister();
MQ_UserLogin();
MQ_GetUNRead();
MQ_GetUserList();
MQ_GetOnlineList();
MQ_TopicCreate();
MQ_GetTopic();
MQ_GetNumber();
MQ_GetTopicList();
MQ_TopicModify();
MQ_TopicDelete();
MQ_UserDelete();

#ifdef _MSC_BUILD
WSACleanup();
#endif
Expand Down
Loading
Loading