Skip to content

Commit 011f461

Browse files
committed
fixed:get serial is incorrent
fixed:does not write message attr to database fixed:does not work that time publish self attr
1 parent 8581c9d commit 011f461

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

XEngine_Source/MQCore_DBModule/DBModule_MQData/DBModule_MQData.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,11 @@ bool CDBModule_MQData::DBModule_MQData_GetSerial(LPCXSTR lpszName, __int64x* pIn
460460
}
461461
nPos++;
462462
if (NULL != pptszResult[nPos])
463+
{
464+
_tcsxcpy(pSt_DBStart->tszUserBelong, pptszResult[nPos]);
465+
}
466+
nPos++;
467+
if (NULL != pptszResult[nPos])
463468
{
464469
_tcsxcpy(pSt_DBStart->tszQueueName, pptszResult[nPos]);
465470
}
@@ -530,6 +535,11 @@ bool CDBModule_MQData::DBModule_MQData_GetSerial(LPCXSTR lpszName, __int64x* pIn
530535
}
531536
nPos++;
532537
if (NULL != pptszResult[nPos])
538+
{
539+
_tcsxcpy(pSt_DBEnd->tszUserBelong, pptszResult[nPos]);
540+
}
541+
nPos++;
542+
if (NULL != pptszResult[nPos])
533543
{
534544
_tcsxcpy(pSt_DBEnd->tszQueueName, pptszResult[nPos]);
535545
}

XEngine_Source/XEngine_MQServiceApp/MQService_TCPTask.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ bool MessageQueue_TCP_Handle(XENGINE_PROTOCOLHDR* pSt_ProtocolHdr, LPCXSTR lpszC
333333
_tcsxcpy(st_DBQueue.tszUserBelong, st_MQProtocol.tszMQUsr);
334334
_tcsxcpy(st_DBQueue.tszQueueName, st_MQProtocol.tszMQKey);
335335
memcpy(st_DBQueue.tszMsgBuffer, lpszMsgBuffer + sizeof(XENGINE_PROTOCOL_XMQ), st_DBQueue.nMsgLen);
336+
memcpy(&st_DBQueue.nMsgAttr, &st_MQProtocol.st_MSGAttr, sizeof(XENGINE_PROTOCOL_MSGATTR));
336337

337338
if (st_MQProtocol.nKeepTime > 0)
338339
{
@@ -421,7 +422,6 @@ bool MessageQueue_TCP_Handle(XENGINE_PROTOCOLHDR* pSt_ProtocolHdr, LPCXSTR lpszC
421422
XEngine_MQXService_Send(pptszListAddr[i], tszSDBuffer, nSDLen, nClientType);
422423
BaseLib_OperatorMemory_Free((XPPPMEM)&pptszListAddr, nListCount);
423424
}
424-
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("%s消息端:%s,主题:%s,序列:%lld,投递数据到消息队列成功,通知客户端个数:%d"), lpszClientType, lpszClientAddr, st_DBQueue.tszQueueName, st_DBQueue.nQueueSerial, nListCount);
425425
}
426426
else
427427
{
@@ -453,7 +453,6 @@ bool MessageQueue_TCP_Handle(XENGINE_PROTOCOLHDR* pSt_ProtocolHdr, LPCXSTR lpszC
453453
}
454454
}
455455
BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_ListUser, nListCount);
456-
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("%s消息端:%s,主题:%s,序列:%lld,投递数据到消息队列成功,通知客户端个数:%d"), lpszClientType, lpszClientAddr, st_DBQueue.tszQueueName, st_DBQueue.nQueueSerial, nListCount);
457456
}
458457
_xstprintf(st_DBQueue.tszQueuePublishTime, _X("0"));
459458
}
@@ -481,6 +480,7 @@ bool MessageQueue_TCP_Handle(XENGINE_PROTOCOLHDR* pSt_ProtocolHdr, LPCXSTR lpszC
481480
ProtocolModule_Packet_Common(nNetType, pSt_ProtocolHdr, &st_MQProtocol, tszSDBuffer, &nSDLen);
482481
XEngine_MQXService_Send(lpszClientAddr, tszSDBuffer, nSDLen, nNetType);
483482
}
483+
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("%s消息端:%s,主题:%s,序列:%lld,投递数据到消息队列成功,发布时间:%s"), lpszClientType, lpszClientAddr, st_DBQueue.tszQueueName, st_DBQueue.nQueueSerial, st_DBQueue.tszQueuePublishTime);
484484
}
485485
else if (XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_MQ_REQGET == pSt_ProtocolHdr->unOperatorCode)
486486
{

XEngine_Source/XEngine_MQServiceApp/MQService_Task.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ void CALLBACK MessageQueue_CBTask_TimePublish(XENGINE_DBTIMERELEASE* pSt_DBInfo,
4040

4141
if (pSt_DBInfo->bBreak)
4242
{
43-
//跳过自己
44-
if (0 == _tcsxncmp(st_DBInfo.tszUserName, ppSt_ListUser[i]->tszUserName, _tcsxlen(st_DBInfo.tszUserName)))
43+
//是否跳过自己
44+
if (0 == _tcsxncmp(st_DBInfo.tszUserName, ppSt_ListUser[i]->tszUserName, _tcsxlen(st_DBInfo.tszUserName)) && (0 == st_MQProtocol.st_MSGAttr.byAttrSelf))
4545
{
4646
continue;
4747
}

0 commit comments

Comments
 (0)