큐 조회 적재 로직 수정

This commit is contained in:
jangdongsin 2025-01-09 00:04:26 +09:00
parent f803f5c5a1
commit 9ea4d7653b

View File

@ -195,20 +195,25 @@ public class QueueServerService extends Service {
private void messageService() throws Exception { private void messageService() throws Exception {
int DB_PROC_COUNT = 0; int DB_PROC_COUNT = 0;
List<BasicMessageDto> list = new ArrayList<>(); List<BasicMessageDto> list = new ArrayList<>();
for (int loopCnt = 0; loopCnt < ServiceUtil.COMMIT_COUNT; loopCnt++) { /* 큐 메시지 조회 */
BasicMessageDto messageDto = readQueue.popMessageFromBuffer(); try {
if (messageDto == null) { for (int loopCnt = 0; loopCnt < ServiceUtil.COMMIT_COUNT; loopCnt++) {
break; BasicMessageDto messageDto = readQueue.popMessageFromBuffer();
if (messageDto == null) {
break;
}
/* MSG ID 채번 */
String msgId = queueInstance.getSerialNumber();
msgId = MessageUtil.makeMessageKey(msgId);
String msgGroupId = msgId.replace("MSGID", "MGRP");
messageDto.setId(msgId);
messageDto.setMsgGroupID(msgGroupId);
list.add(messageDto);
DB_PROC_COUNT++;
SUM_COMMIT_COUNT++;
} }
/* MSG ID 채번 */ } catch (Exception e) {
String msgId = queueInstance.getSerialNumber(); saveLog(e);
msgId = MessageUtil.makeMessageKey(msgId);
String msgGroupId = msgId.replace("MSGID", "MGRP");
messageDto.setId(msgId);
messageDto.setMsgGroupID(msgGroupId);
list.add(messageDto);
DB_PROC_COUNT++;
SUM_COMMIT_COUNT++;
} }
// DB 처리한 카운트에 대한 처리 // DB 처리한 카운트에 대한 처리