클라이언트 IP체크, 큐 DB 적재 로직 수정
This commit is contained in:
parent
fda519db46
commit
f803f5c5a1
@ -64,9 +64,9 @@ public abstract class QueuePool {
|
||||
public void pushQueue(BasicMessageDto data) throws Exception {
|
||||
synchronized(lockMonitor) {
|
||||
if (queuePool.isEmpty()) {
|
||||
try{
|
||||
try {
|
||||
lockMonitor.wait();
|
||||
}catch(InterruptedException e){
|
||||
} catch (InterruptedException e) {
|
||||
// 아무 처리도 하지 않는다.
|
||||
}
|
||||
}
|
||||
|
||||
@ -195,13 +195,16 @@ public abstract class ReadQueue {
|
||||
/* Pop Counter 증가 및 저장 */
|
||||
this.popCounter = this.popCounter + 1;
|
||||
writePopCounter();
|
||||
|
||||
|
||||
}
|
||||
|
||||
return messageDto;
|
||||
}
|
||||
|
||||
public void resetPopCounter(int resetCounter) throws IOException {
|
||||
this.popCounter = this.popCounter - resetCounter;
|
||||
writePopCounter();
|
||||
}
|
||||
|
||||
abstract void popBuffer() throws Exception;
|
||||
abstract void getBytesForExtendMessage(BasicMessageDto messageDto) throws UnsupportedEncodingException;
|
||||
abstract void initDataBuffer();
|
||||
|
||||
@ -213,8 +213,18 @@ public class QueueServerService extends Service {
|
||||
|
||||
// DB 처리한 카운트에 대한 처리
|
||||
if (DB_PROC_COUNT > 0) {
|
||||
worker.saveMessageForList(list);
|
||||
Thread.sleep(10);
|
||||
boolean isError = false;
|
||||
try {
|
||||
worker.saveMessageForList(list);
|
||||
Thread.sleep(10);
|
||||
} catch (Exception e) {
|
||||
saveLog(e);
|
||||
isError = true;
|
||||
}
|
||||
/* DB 적재 실패시 처리 */
|
||||
if (isError) {
|
||||
readQueue.resetPopCounter(DB_PROC_COUNT);
|
||||
}
|
||||
} else {
|
||||
Thread.sleep(100);
|
||||
}
|
||||
|
||||
@ -756,10 +756,10 @@ public class CollectServerTask extends Thread {
|
||||
saveLog(printTaskLog() + "[REMOTE IP : " + connectUserDto.getRemoteIP() + "]");
|
||||
saveLog(printTaskLog() + "[ALLOW IP BASIC : " + memberDto.getAllowIpBasic() + "]");
|
||||
saveLog(printTaskLog() + "[ALLOW IP EXTEND : " + memberDto.getAllowIpExtend() + "]");
|
||||
if (memberDto.getAllowIpBasic() != null && connectUserDto.getRemoteIP().equals(memberDto.getAllowIpBasic())) {
|
||||
if (memberDto.getAllowIpBasic() != null && connectUserDto.getRemoteIP().indexOf(memberDto.getAllowIpBasic()) >= 0) {
|
||||
isPermit = true;
|
||||
}
|
||||
if (memberDto.getAllowIpExtend() != null && connectUserDto.getRemoteIP().equals(memberDto.getAllowIpExtend())) {
|
||||
if (memberDto.getAllowIpExtend() != null && connectUserDto.getRemoteIP().indexOf(memberDto.getAllowIpExtend()) >= 0) {
|
||||
isPermit = true;
|
||||
}
|
||||
} else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user