shjung 1 år sedan
förälder
incheckning
cd795e11b7
29 ändrade filer med 1442 tillägg och 7 borttagningar
  1. 1 0
      .idea/gradle.xml
  2. 11 0
      conf/evps-comm-local.yml
  3. 2 1
      conf/evps-comm-server.yml
  4. 55 0
      evps-comm-local/build.gradle
  5. 11 0
      evps-comm-local/conf/evps-comm-local.yml
  6. 88 0
      evps-comm-local/src/main/java/com/evps/comm/local/EvpsCommLocalApplication.java
  7. 44 0
      evps-comm-local/src/main/java/com/evps/comm/local/config/ApplicationConfig.java
  8. 44 0
      evps-comm-local/src/main/java/com/evps/comm/local/config/SchedulingConfig.java
  9. 79 0
      evps-comm-local/src/main/java/com/evps/comm/local/dto/CenterDto.java
  10. 34 0
      evps-comm-local/src/main/java/com/evps/comm/local/dto/PacketSequence.java
  11. 95 0
      evps-comm-local/src/main/java/com/evps/comm/local/repository/ApplicationRepository.java
  12. 47 0
      evps-comm-local/src/main/java/com/evps/comm/local/scheduler/ApplicationScheduler.java
  13. 263 0
      evps-comm-local/src/main/java/com/evps/comm/local/service/EvpsDataSimGen.java
  14. 82 0
      evps-comm-local/src/main/java/com/evps/comm/local/service/EvpsLocalClientManagerService.java
  15. 120 0
      evps-comm-local/src/main/java/com/evps/comm/local/xnet/client/EvpsLocalClient.java
  16. 44 0
      evps-comm-local/src/main/java/com/evps/comm/local/xnet/client/EvpsLocalClientBootstrapFactory.java
  17. 71 0
      evps-comm-local/src/main/java/com/evps/comm/local/xnet/client/EvpsLocalClientCommService.java
  18. 22 0
      evps-comm-local/src/main/java/com/evps/comm/local/xnet/client/codec/EvpsLocalClientDecoder.java
  19. 74 0
      evps-comm-local/src/main/java/com/evps/comm/local/xnet/client/codec/EvpsLocalClientEncoder.java
  20. 67 0
      evps-comm-local/src/main/java/com/evps/comm/local/xnet/client/handler/EvpsLocalClientPacketInboundHandler.java
  21. 9 0
      evps-comm-local/src/main/java/com/evps/comm/local/xnet/client/process/request/ReqEvpsLocalData.java
  22. 24 0
      evps-comm-local/src/main/java/com/evps/comm/local/xnet/client/process/request/ReqEvpsNetPing.java
  23. 48 0
      evps-comm-local/src/main/resources/application.yml
  24. 2 0
      evps-comm-local/src/main/resources/log4jdbc.log4j2.properties
  25. 41 0
      evps-comm-local/src/main/resources/logback-spring-appender.xml
  26. 49 0
      evps-comm-local/src/main/resources/logback-spring.xml
  27. 14 0
      evps-comm-server/src/main/resources/application.yml
  28. 0 6
      evps-kafka-producer/src/main/resources/application.yml
  29. 1 0
      settings.gradle

+ 1 - 0
.idea/gradle.xml

@@ -8,6 +8,7 @@
         <option name="modules">
           <set>
             <option value="$PROJECT_DIR$" />
+            <option value="$PROJECT_DIR$/evps-comm-local" />
             <option value="$PROJECT_DIR$/evps-comm-server" />
             <option value="$PROJECT_DIR$/evps-common" />
             <option value="$PROJECT_DIR$/evps-consumer" />

+ 11 - 0
conf/evps-comm-local.yml

@@ -0,0 +1,11 @@
+spring:
+  profiles:
+    active: dev
+
+application:
+  process-id: evps-comm-local
+  region-id: 186
+  server-ip: 192.168.20.44
+  server-port: 7800
+  connection-timeout: 5
+  retry-connect-seconds: 60

+ 2 - 1
conf/evps-comm-server.yml

@@ -1,6 +1,7 @@
 spring:
   profiles:
-    active: dev
+    #active: dev
+    active: comp
 server:
   port: 9870
 

+ 55 - 0
evps-comm-local/build.gradle

@@ -0,0 +1,55 @@
+plugins {
+    id 'java'
+    id 'maven-publish' // maven 사용
+}
+
+group = 'com.evps'
+version = '0.0.1'
+
+sourceCompatibility = '1.8'
+targetCompatibility = '1.8'
+compileJava.options.encoding = 'UTF-8'
+
+repositories {
+    mavenLocal()
+    mavenCentral()
+    flatDir(dir: 'C:\\java\\repository\\')
+}
+
+dependencies {
+    // lombok 라이브러리 추가 시작
+    compileOnly 'org.projectlombok:lombok'
+    annotationProcessor 'org.projectlombok:lombok'
+    testCompileOnly 'org.projectlombok:lombok'
+    testAnnotationProcessor 'org.projectlombok:lombok'
+    // lombok 라이브러리 추가 끝
+
+    implementation 'org.springframework.boot:spring-boot-starter-web'
+    implementation 'org.springframework.boot:spring-boot-starter-actuator'
+    implementation 'org.springframework.boot:spring-boot-starter-aop'
+
+    implementation 'io.netty:netty-all:4.1.52.Final'
+
+    implementation 'com.evps:evps-common:0.0.1'
+    implementation 'com.its:its-common:0.0.1'
+    implementation 'com.its:its-network:0.0.1'
+    implementation 'com.its:its-spring:0.0.1'
+
+
+    testImplementation 'org.springframework.boot:spring-boot-starter-test'
+}
+
+test {
+    useJUnitPlatform()
+}
+
+jar {
+    enabled = false
+}
+
+compileJava.options.encoding = 'UTF-8'
+tasks.withType(JavaCompile).configureEach {
+    options.compilerArgs << '-Xlint:unchecked'
+    options.deprecation = true
+    options.encoding = 'UTF-8'
+}

+ 11 - 0
evps-comm-local/conf/evps-comm-local.yml

@@ -0,0 +1,11 @@
+spring:
+  profiles:
+    active: dev
+
+application:
+  process-id: evps-comm-local
+  region-id: 183
+  server-ip: 10.4.4.51
+  server-port: 7800
+  connection-timeout: 5
+  retry-connect-seconds: 60

+ 88 - 0
evps-comm-local/src/main/java/com/evps/comm/local/EvpsCommLocalApplication.java

@@ -0,0 +1,88 @@
+package com.evps.comm.local;
+
+import com.evps.comm.local.repository.ApplicationRepository;
+import com.evps.comm.local.xnet.client.EvpsLocalClientCommService;
+import com.its.common.spring.SpringUtils;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.DisposableBean;
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.boot.Banner;
+import org.springframework.boot.CommandLineRunner;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.builder.SpringApplicationBuilder;
+import org.springframework.boot.context.ApplicationPidFileWriter;
+import org.springframework.context.ApplicationListener;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.event.ContextClosedEvent;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+@Slf4j
+@SpringBootApplication
+@EnableTransactionManagement
+@ComponentScan(basePackages = {"com.its.common.spring", "com.evps.comm.local.config", "com.evps.comm.local"})
+public class EvpsCommLocalApplication implements CommandLineRunner, ApplicationListener<ContextClosedEvent>, InitializingBean, DisposableBean {
+
+    private static final String APPLICATION_NAME = "evps-comm-local";
+
+    public static void main(String[] args) {
+        SpringApplication application = new SpringApplicationBuilder()
+                .sources(EvpsCommLocalApplication.class)
+                .listeners(new ApplicationPidFileWriter("./conf/" + APPLICATION_NAME + ".pid"))
+                .build();
+        application.setBannerMode(Banner.Mode.OFF);
+        application.run(args);
+    }
+
+    @Override
+    public void run(String... args) throws Exception {
+        SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        log.info("");
+        log.info("");
+        log.info("************************************************************************************");
+        log.info("**                                                                                **");
+        log.info("**                            UTIC Signal System                                  **");
+        log.info("**     UTIC Emergency Vehicle Preemption System Communication Local Program.      **");
+        log.info("**                                                                                **");
+        log.info("**                                                                   [ver.1.0]    **");
+        log.info("** startup: {}", sdfDate.format(new Date()));
+        log.info("************************************************************************************");
+
+        ApplicationRepository applicationRepository = SpringUtils.getBean(ApplicationRepository.class);
+        applicationRepository.loadDb();
+
+        EvpsLocalClientCommService itsAsnClientCommService = SpringUtils.getBean(EvpsLocalClientCommService.class);
+        itsAsnClientCommService.run();
+    }
+
+    @Override
+    public void onApplicationEvent(ContextClosedEvent contextClosedEvent) {
+        SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
+        log.error("************************************************************************************");
+        log.error("**    Application Terminated: {}, {}, {}",
+                sdfDate.format(new Date()), contextClosedEvent.getTimestamp(), contextClosedEvent);
+
+        try {
+            EvpsLocalClientCommService itsAsnClientCommService = SpringUtils.getBean(EvpsLocalClientCommService.class);
+            itsAsnClientCommService.shutdown();
+        }
+        catch (Exception e) {
+            log.error("**    onApplicationEvent Exception: {}", e.getMessage());
+        }
+        log.error("************************************************************************************");
+    }
+
+    @Override
+    public void destroy() throws Exception {
+        log.error("Application destroy.");
+    }
+
+    @Override
+    public void afterPropertiesSet() throws Exception {
+        log.info("Application afterPropertiesSet.");
+    }
+}

+ 44 - 0
evps-comm-local/src/main/java/com/evps/comm/local/config/ApplicationConfig.java

@@ -0,0 +1,44 @@
+package com.evps.comm.local.config;
+
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.PostConstruct;
+
+@Slf4j
+@Getter
+@Setter
+@ToString
+@Component
+@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})
+@ConfigurationProperties(prefix = "application")
+public class ApplicationConfig {
+
+    private String processId = "evps-comm-local";
+    private String regionId = "186";
+    private String serverIp = "10.4.4.51";
+    private int serverPort = 7800;
+    private int connectionTimeout = 5;
+    private int retryConnectSeconds = 60;
+
+    @PostConstruct
+    private void init() {
+        if (this.connectionTimeout < 5) {
+            this.connectionTimeout = 10;
+        }
+
+        log.info("[{}] -------------------------", this.getClass().getSimpleName());
+        log.info("[{}]           server Ip: {}", this.getClass().getSimpleName(), this.serverIp);
+        log.info("[{}]         server Port: {}", this.getClass().getSimpleName(), this.serverPort);
+        log.info("[{}]   ConnectionTimeout: {}", this.getClass().getSimpleName(), this.connectionTimeout);
+        log.info("[{}] RetryConnectSeconds: {}", this.getClass().getSimpleName(), this.retryConnectSeconds);
+        log.info("{}", super.toString());
+    }
+
+}

+ 44 - 0
evps-comm-local/src/main/java/com/evps/comm/local/config/SchedulingConfig.java

@@ -0,0 +1,44 @@
+package com.evps.comm.local.config;
+
+import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.annotation.SchedulingConfigurer;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
+import org.springframework.scheduling.config.ScheduledTaskRegistrar;
+
+import javax.annotation.PostConstruct;
+
+@Slf4j
+@Data
+@Configuration
+@ConfigurationProperties(prefix = "application.scheduling")
+public class SchedulingConfig implements SchedulingConfigurer {
+
+    private int poolCore = 0;
+
+    private final int scheduleThreadPoolSize = 10;
+
+    @PostConstruct
+    private void init() {
+        log.info("[{}] ------------", this.getClass().getSimpleName());
+        if (this.poolCore == 0) {
+            log.warn("[{}] poolCore size set as default: {} EA.", this.getClass().getSimpleName(), this.poolCore);
+            this.poolCore = 10;
+        }
+        log.info("[{}] poolCore: {} EA.", this.getClass().getSimpleName(), this.poolCore);
+    }
+
+    @Override
+    public void configureTasks(ScheduledTaskRegistrar scheduledTaskRegistrar) {
+
+        ThreadPoolTaskScheduler threadPoolTaskScheduler = new ThreadPoolTaskScheduler();
+
+        threadPoolTaskScheduler.setPoolSize(this.scheduleThreadPoolSize);
+        threadPoolTaskScheduler.setThreadNamePrefix("scheduler-");
+        threadPoolTaskScheduler.initialize();
+
+        scheduledTaskRegistrar.setTaskScheduler(threadPoolTaskScheduler);
+    }
+}

+ 79 - 0
evps-comm-local/src/main/java/com/evps/comm/local/dto/CenterDto.java

@@ -0,0 +1,79 @@
+package com.evps.comm.local.dto;
+
+import com.evps.comm.local.xnet.client.process.request.ReqEvpsLocalData;
+import com.evps.common.dto.NET;
+import com.evps.common.dto.NetState;
+import io.netty.channel.ChannelFuture;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+
+import java.io.Serializable;
+
+@Slf4j
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class CenterDto implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    private int idx;
+    private String centerId;        /* 센터 ID                       */
+    private String centerInfo;      /* 센터 NAME                     */
+    private String ipAddress;       /* 통신 IP                       */
+    private int commPort;           /* 통신 포트                     */
+    private String datexUser;       /* 사용자명                      */
+    private String datexPasswd;     /* 사용자비밀번호                */
+    private int heartBeat;          /* 허트비트 주기                 */
+    private int resTime;            /* 응답시간                      */
+    private int datagramSize;       /* 데이터그램 크기               */
+
+    private boolean commLogging;
+    private PacketSequence seq;
+    private NetState netState;
+    private long lastCommTm;
+
+
+    public void setCenter(CenterDto dto) {
+        this.idx = dto.getIdx();
+        this.centerId = dto.getCenterId();
+        this.centerInfo = dto.getCenterInfo();
+        this.ipAddress = dto.getIpAddress();
+        this.commPort = dto.getCommPort();
+        this.datexUser = dto.getDatexUser();
+        this.datexPasswd = dto.getDatexPasswd();
+        this.heartBeat = dto.getHeartBeat();
+        this.resTime = dto.getResTime();
+        this.datagramSize = dto.getDatagramSize();
+        this.commLogging = dto.isCommLogging();
+        this.lastCommTm = dto.getLastCommTm();
+        this.seq = new PacketSequence();
+        this.netState = new NetState();
+    }
+    public String getLogKey() {
+        return this.centerId;
+    }
+
+    public boolean sendData(ReqEvpsLocalData data) {
+        if (this.netState.getChannel() == null) {
+            log.warn("SEND: [{}, {}]. Channel closed. {}.", this.centerId, this.ipAddress, msg);
+            return false;
+        }
+        ChannelFuture f = this.netState.getChannel().writeAndFlush(c2c);
+        f.awaitUninterruptibly();
+        if (f.isDone() || f.isSuccess()) {
+            log.info("SEND: [{}, {}]. Packet send Ok. {}.", this.centerId, this.ipAddress, msg);
+            return true;
+        }
+        log.error("SEND: [{}, {}]. Packet send Failed. {}. will be closed.", this.centerId, this.ipAddress, msg);
+        return false;
+    }
+
+    public boolean channelOpened() {
+        return this.netState.getChannel() != null && this.netState.getState() == NET.DATA_TRANS;
+    }
+
+}

+ 34 - 0
evps-comm-local/src/main/java/com/evps/comm/local/dto/PacketSequence.java

@@ -0,0 +1,34 @@
+package com.evps.comm.local.dto;
+
+public class PacketSequence {
+
+    private Integer seq = 1;
+
+    public PacketSequence() {
+        this.seq = 1;
+    }
+
+    public PacketSequence(int num) {
+        this.seq = num;
+    }
+
+    public int nextValue() {
+        synchronized(this.seq) {
+            if (this.seq == 0xEFFFFFFF) {
+                this.seq = 1;
+            } else {
+                this.seq = this.seq + 1;
+            }
+        }
+
+        return this.seq;
+    }
+
+    public int currentValue() {
+        return this.seq;
+    }
+
+    public void resetValue() {
+        this.seq = 1;
+    }
+}

+ 95 - 0
evps-comm-local/src/main/java/com/evps/comm/local/repository/ApplicationRepository.java

@@ -0,0 +1,95 @@
+package com.evps.comm.local.repository;
+
+import com.evps.comm.local.config.ApplicationConfig;
+import com.evps.comm.local.dto.CenterDto;
+import com.evps.comm.local.dto.PacketSequence;
+import com.evps.common.dto.NetState;
+import com.its.common.network.NettyUtils;
+import com.its.common.spring.SpringUtils;
+import io.netty.channel.Channel;
+import io.netty.util.AttributeKey;
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+
+@Slf4j
+@Getter
+@Service
+@RequiredArgsConstructor
+public class ApplicationRepository {
+
+    public static final AttributeKey<CenterDto> CENTER_ATTRIBUTE_KEY = AttributeKey.valueOf("centerInfo");
+
+    public static final CenterDto center = new CenterDto();
+
+
+    public static void closeChannel(CenterDto center, Channel channel) {
+        try {
+            if (channel != null) {
+                channel.flush();
+                channel.disconnect();
+                channel.close();
+            }
+        }
+        catch (Exception e) {
+            log.error("ApplicationRepository.closeChannel Exception: {}", e.getMessage());
+        }
+    }
+    public static void setCenterObject(Channel channel, CenterDto center) {
+        channel.attr(ApplicationRepository.CENTER_ATTRIBUTE_KEY).set(center);
+    }
+    public static CenterDto getCenterObject(Channel channel) {
+        CenterDto center = channel.attr(ApplicationRepository.CENTER_ATTRIBUTE_KEY).get();
+        if (center == null) {
+            log.warn("ApplicationRepository.getCenterObject: {}, Not Found Channel Object. Will be closed.", NettyUtils.getAddress(channel));
+            closeChannel(null, channel);
+            return null;
+        }
+        return center;
+    }
+
+    @PostConstruct
+    private void init() {
+        log.info("AppRepositoryService.init: Start.");
+        log.info("AppRepositoryService.init: ..End.");
+    }
+
+    public void loadDb() {
+        loadCenterInfo();
+    }
+
+    private void loadCenterInfo() {
+        ApplicationConfig config = SpringUtils.getBean(ApplicationConfig.class);
+        try {
+            CenterDto dto = CenterDto.builder()
+                    .idx(0)
+                    .centerId("L00")
+                    .centerInfo("도시교통정보센터")
+                    .ipAddress(config.getServerIp())
+                    .commPort(config.getServerPort())
+                    .datexUser("EVPS")
+                    .datexPasswd("EVPS")
+                    .heartBeat(0)
+                    .resTime(0)
+                    .datagramSize(8192)
+                    .commLogging(false)
+                    .lastCommTm(0)
+                    .seq(new PacketSequence())
+                    .netState(new NetState())
+                    .build();
+            ApplicationRepository.center.setCenter(dto);
+        }
+        catch (Exception e) {
+            log.error("ApplicationRepository.loadCenterInfo: {}.", e.toString());
+        }
+    }
+    @PreDestroy
+    public void destroyService() {
+        log.error("ApplicationRepository.destroyService. system terminated.......");
+    }
+
+}

+ 47 - 0
evps-comm-local/src/main/java/com/evps/comm/local/scheduler/ApplicationScheduler.java

@@ -0,0 +1,47 @@
+package com.evps.comm.local.scheduler;
+
+import com.evps.comm.local.service.EvpsLocalClientManagerService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.PreDestroy;
+
+@Slf4j
+@RequiredArgsConstructor
+@EnableScheduling
+@Component
+public class ApplicationScheduler {
+
+    private final EvpsLocalClientManagerService evpsLocalClientManagerService;
+    @PreDestroy
+    public void onShutDown() {
+        log.info("ApplicationScheduler.onShutDown: Shutting down...");
+    }
+
+    @Async
+    @Scheduled(cron = "10 0/10 * * * *")  // 10분주기 작업 실행
+    public void sendEvpsCommLocalData() {
+        try {
+            this.evpsLocalClientManagerService.run();
+        }
+        catch(Exception e) {
+            log.error("ApplicationScheduler.sendEvpsCommLocalData: Exception {}", e.getMessage());
+        }
+    }
+
+    @Async
+    @Scheduled(cron = "0/5 * * * * *")
+    public void sendEvpsPing() {
+        try {
+            this.evpsLocalClientManagerService.sendPing();
+        }
+        catch(Exception e) {
+            log.error("ApplicationScheduler.sendEvpsPing: Exception {}", e.getMessage());
+        }
+    }
+
+}

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 263 - 0
evps-comm-local/src/main/java/com/evps/comm/local/service/EvpsDataSimGen.java


+ 82 - 0
evps-comm-local/src/main/java/com/evps/comm/local/service/EvpsLocalClientManagerService.java

@@ -0,0 +1,82 @@
+package com.evps.comm.local.service;
+
+import com.evps.comm.local.config.ApplicationConfig;
+import com.evps.comm.local.dto.CenterDto;
+import com.evps.comm.local.repository.ApplicationRepository;
+import com.evps.comm.local.xnet.client.process.request.ReqEvpsNetPing;
+import com.evps.common.dto.NET;
+import com.evps.common.kafka.dto.*;
+import com.evps.common.utils.EvpsUtils;
+import com.its.common.utils.Elapsed;
+import com.its.common.utils.TimeUtils;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.PostConstruct;
+
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class EvpsLocalClientManagerService {
+
+    private final ApplicationConfig config;
+    private boolean isRunning = false;
+
+    @PostConstruct
+    private void init() {
+        this.isRunning = false;
+    }
+
+    public void sendPing() {
+        CenterDto center = ApplicationRepository.center;
+        if (center.getNetState().getState() < NET.LOGIN_WAIT || center.getNetState().getChannel() == null) {
+            return;
+        }
+
+        ReqEvpsNetPing ping = new ReqEvpsNetPing(center.getSeq().nextValue());
+        center.sen
+    }
+
+    public void run() {
+        if (this.isRunning) {
+            log.warn("EvpsLocalClientManagerService: Already running....................");
+            return;
+        }
+
+        this.isRunning = true;
+        Elapsed elapsed = new Elapsed();
+
+        EvpsDataSimGen simGenData = new EvpsDataSimGen(this.config.getRegionId(), "대종로 사거리", "74무5035", 2);
+
+        simGenData.makeEvpsKafkaSimulatorData();
+
+        KafkaEvpsServiceDto serviceDto = simGenData.getServiceStartDto();
+        serviceDto.setClctDt(EvpsUtils.getClctDt());
+//        this.kafkaProducerService.sendEvpsServiceTopic(serviceDto);
+
+        KafkaEvpsNodeDto nodeDto = simGenData.getEvpsNodeDto();
+        nodeDto.setClctDt(EvpsUtils.getClctDt());
+//        this.kafkaProducerService.sendEvpsNodeTopic(nodeDto);
+
+        for (int ii = 0; ii < simGenData.getListSignalDto().size(); ii++) {
+            TimeUtils.sleep(1000);
+
+            KafkaEvpsSignalDto signalDto = simGenData.getListSignalDto().get(ii);
+            signalDto.setClctDt(EvpsUtils.getClctDt());
+//            this.kafkaProducerService.sendEvpsSignalTopic(signalDto);
+
+            KafkaEvpsEventDto eventDto = simGenData.getListEventDto().get(ii);
+            eventDto.setClctDt(EvpsUtils.getClctDt());
+//            this.kafkaProducerService.sendEvpsEventTopic(eventDto);
+        }
+
+        KafkaEvpsServiceEndDto endDto = simGenData.getServiceEndDto();
+        endDto.setClctDt(EvpsUtils.getClctDt());
+//        this.kafkaProducerService.sendEvpsServiceEndTopic(endDto);
+
+        log.info("EvpsLocalClientManagerService: Run completed. {}", elapsed.elapsedTimeStr());
+        this.isRunning = false;
+    }
+
+}

+ 120 - 0
evps-comm-local/src/main/java/com/evps/comm/local/xnet/client/EvpsLocalClient.java

@@ -0,0 +1,120 @@
+package com.evps.comm.local.xnet.client;
+
+import com.evps.comm.local.config.ApplicationConfig;
+import com.evps.comm.local.dto.CenterDto;
+import com.evps.comm.local.repository.ApplicationRepository;
+import com.evps.comm.local.xnet.client.codec.EvpsLocalClientDecoder;
+import com.evps.comm.local.xnet.client.codec.EvpsLocalClientEncoder;
+import com.evps.comm.local.xnet.client.handler.EvpsLocalClientPacketInboundHandler;
+import io.netty.bootstrap.Bootstrap;
+import io.netty.channel.*;
+import io.netty.channel.socket.SocketChannel;
+import io.netty.handler.logging.LogLevel;
+import io.netty.handler.logging.LoggingHandler;
+import io.netty.handler.timeout.IdleStateHandler;
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+import lombok.Setter;
+import lombok.extern.slf4j.Slf4j;
+
+import java.net.InetSocketAddress;
+import java.util.concurrent.Callable;
+import java.util.concurrent.TimeUnit;
+
+@Slf4j
+@Getter
+@Setter
+@RequiredArgsConstructor
+public class EvpsLocalClient implements Callable<Object> {
+
+    private final CenterDto center;
+    private final ApplicationConfig config;
+    private final EvpsLocalClientBootstrapFactory bootstrapFactory;
+    private final EvpsLocalClientPacketInboundHandler evpsLocalClientPacketInboundHandler;
+    private final EvpsLocalClientEncoder evpsLocalClientEncoder;
+
+    private Bootstrap bootstrap = null;
+    private ChannelFuture channelFuture = null;
+    private String ipAddress;
+    private int port;
+
+    @Override
+    public Object call() {
+
+        this.ipAddress = this.center.getIpAddress();
+        this.port = this.center.getCommPort();
+
+        log.info("EvpsLocalClient Start: [{}, {}], {}", this.center.getCenterId(), this.ipAddress, this.port);
+        if (this.bootstrap == null) {
+            this.bootstrap = this.bootstrapFactory.createBootstrap();
+            this.bootstrap.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, this.config.getConnectionTimeout() * 1000);
+            this.bootstrap.handler(new ChannelInitializer<SocketChannel>() {
+                // 핸들러가 실행되는 순서는 추가된 순서에 의해 결정된다.(Inbound: head=>tail, Outbound: tail=>head, name2ctx)
+                @Override
+                public void initChannel(SocketChannel ch) {
+                    if (center.isCommLogging()) {
+                        ch.pipeline().addLast(new LoggingHandler(LogLevel.INFO));
+                    }
+                    IdleStateHandler idleStateHandler = new IdleStateHandler(center.getHeartBeat(), 0,0, TimeUnit.SECONDS);
+
+                    ch.pipeline().addLast("evpsLocalIdleStateHandler",           idleStateHandler);
+                    ch.pipeline().addLast("evpsLocalClientDecoder",              new EvpsLocalClientDecoder());            // Decoding handler
+                    ch.pipeline().addLast("evpsLocalClientPacketInboundHandler", evpsLocalClientPacketInboundHandler);     // Packet Inbound handler
+                    ch.pipeline().addLast("evpsLocalClientEncoder",              evpsLocalClientEncoder);            // Encoding handler
+                }
+            });
+        }
+
+        log.info("EvpsLocalClient Connect Try: [{}, {}], {}", this.center.getCenterId(), this.ipAddress, this.port);
+        if (this.channelFuture != null && this.channelFuture.channel() != null) {
+            this.channelFuture.channel().close();
+            this.channelFuture = null;
+        }
+        this.channelFuture = this.bootstrap.connect(new InetSocketAddress(this.ipAddress, this.port));
+
+        // 연결 리스너 추가
+        this.channelFuture.addListener(new ChannelFutureListener() {
+            @Override
+            public void operationComplete(ChannelFuture future) {
+                if (future.isSuccess()) {
+                    channelOpen(future.channel());
+                } else {
+                    log.error("EvpsLocalClient Connect Failed: [{}, {}], {}, Exception {}", center.getCenterId(), center.getIpAddress(), center.getCommPort(), future.cause().getMessage());
+                }
+            }
+        });
+
+        // 연결 종료 리스너 추가
+        this.channelFuture.channel().closeFuture().addListener(new ChannelFutureListener() {
+            @Override public void operationComplete(ChannelFuture future) {
+                channelClosed(future.channel());
+            }
+        });
+
+        return null;
+    }
+
+    /**
+     * 연결 성공시 처리 이벤트
+     * @param channel
+     */
+    protected void channelOpen(Channel channel) {
+        log.info("EvpsLocalClient Connect Success. [{}, {}], {}, Channel: {}", this.center.getCenterId(), this.center.getIpAddress(), this.center.getCommPort(), channel);
+        ApplicationRepository.setCenterObject(channel, this.center);
+        this.center.getNetState().connect(channel);
+    }
+
+    /**
+     * 연결 종료시 처리 이벤트
+     * @param channel
+     */
+    protected synchronized void channelClosed(Channel channel) {
+        log.warn("EvpsLocalClient Connect Closed. [{}, {}], {}, Channel: {}", this.center.getCenterId(), this.center.getIpAddress(), this.center.getCommPort(), channel);
+
+        ApplicationRepository.setCenterObject(channel, null);
+        this.center.getNetState().disConnect();
+        channel.close();
+        channel.eventLoop().schedule(this, this.config.getRetryConnectSeconds(), TimeUnit.SECONDS);
+    }
+
+}

+ 44 - 0
evps-comm-local/src/main/java/com/evps/comm/local/xnet/client/EvpsLocalClientBootstrapFactory.java

@@ -0,0 +1,44 @@
+package com.evps.comm.local.xnet.client;
+
+import com.its.common.network.NettyUtils;
+import io.netty.bootstrap.Bootstrap;
+import io.netty.channel.ChannelFuture;
+import io.netty.channel.ChannelOption;
+import io.netty.channel.EventLoopGroup;
+import io.netty.channel.socket.nio.NioSocketChannel;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+
+@Slf4j
+@RequiredArgsConstructor
+public class EvpsLocalClientBootstrapFactory {
+
+    private final int workerThread;
+    private final int connectTimeout;
+    private EventLoopGroup nioEventLoopGroup = null;
+
+    public Bootstrap createBootstrap() {
+        if (this.nioEventLoopGroup == null) {
+            this.nioEventLoopGroup = NettyUtils.newEventLoopGroup(this.workerThread, "vdsEventGroup");//new NioEventLoopGroup(this.workerThread);  //EpollEventLoopGroup
+        }
+        Bootstrap bootstrap = new Bootstrap();
+        bootstrap.group(this.nioEventLoopGroup);
+
+        bootstrap.channel(NioSocketChannel.class);
+        bootstrap.option(ChannelOption.AUTO_READ, true);
+        bootstrap.option(ChannelOption.TCP_NODELAY, true);
+        bootstrap.option(ChannelOption.SO_RCVBUF, 8192);
+        bootstrap.option(ChannelOption.SO_SNDBUF, 8192*4);
+        bootstrap.option(ChannelOption.SO_KEEPALIVE, false);
+        //bootstrap.option(ChannelOption.RCVBUF_ALLOCATOR, new FixedRecvByteBufAllocator(2048));
+        bootstrap.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, this.connectTimeout * 1000);
+        return bootstrap;
+    }
+
+    public EventLoopGroup getEventLoopGroup() {
+        return this.nioEventLoopGroup;
+    }
+    public void addChannelFuture(ChannelFuture future) {
+        //this.channelFutures.add(future);
+    }
+}

+ 71 - 0
evps-comm-local/src/main/java/com/evps/comm/local/xnet/client/EvpsLocalClientCommService.java

@@ -0,0 +1,71 @@
+package com.evps.comm.local.xnet.client;
+
+import com.evps.comm.local.config.ApplicationConfig;
+import com.evps.comm.local.dto.CenterDto;
+import com.evps.comm.local.repository.ApplicationRepository;
+import com.evps.comm.local.xnet.client.codec.EvpsLocalClientEncoder;
+import com.evps.comm.local.xnet.client.handler.EvpsLocalClientPacketInboundHandler;
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.PostConstruct;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+
+@Slf4j
+@Getter
+@RequiredArgsConstructor
+@Service
+public class EvpsLocalClientCommService {
+
+    private final ApplicationConfig config;
+    private final ApplicationRepository repo;
+    private final EvpsLocalClientPacketInboundHandler evpsLocalClientPacketInboundHandler;
+    private final EvpsLocalClientEncoder evpsLocalClientEncoder;
+
+    private final ExecutorService executorService= Executors.newFixedThreadPool(1);
+    private final List<EvpsLocalClient> clientTasks = Collections.synchronizedList(new ArrayList<>());
+
+    private EvpsLocalClientBootstrapFactory bootstrapFactory;
+
+    @PostConstruct
+    void init() {
+        this.bootstrapFactory = new EvpsLocalClientBootstrapFactory(1, this.config.getConnectionTimeout());
+    }
+
+    public void run() {
+        log.info("ItsAsnClientCommService.run: Start.");
+
+        /**
+         * 센터 접속
+         */
+        CenterDto center = ApplicationRepository.center;
+        EvpsLocalClient asnClient = new EvpsLocalClient(center, this.config, this.bootstrapFactory,
+                this.evpsLocalClientPacketInboundHandler, this.evpsLocalClientEncoder);
+        this.clientTasks.add(asnClient);
+
+        try {
+            List<Future<Object>> futures = this.executorService.invokeAll(this.clientTasks);
+            log.info("ItsAsnClientCommService.run: futures, {} EA.", (long)futures.size());
+        }
+        catch(InterruptedException e) {
+            log.error("ItsAsnClientCommService.run: Exception: InterruptedException");
+            Thread.currentThread().interrupt();
+        }
+        log.info("ItsAsnClientCommService.run: ..End.");
+    }
+
+    public void shutdown() {
+        CenterDto obj = ApplicationRepository.center;
+        if (obj.getNetState().getChannel() != null) {
+            obj.getNetState().getChannel().close();
+        }
+        this.bootstrapFactory.getEventLoopGroup().shutdownGracefully();
+    }
+}

+ 22 - 0
evps-comm-local/src/main/java/com/evps/comm/local/xnet/client/codec/EvpsLocalClientDecoder.java

@@ -0,0 +1,22 @@
+package com.evps.comm.local.xnet.client.codec;
+
+import io.netty.buffer.ByteBuf;
+import io.netty.channel.ChannelHandlerContext;
+import io.netty.handler.codec.MessageToMessageDecoder;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+
+import java.util.List;
+
+
+@Slf4j
+@RequiredArgsConstructor
+//@Component
+//@ChannelHandler.Sharable
+public class EvpsLocalClientDecoder extends MessageToMessageDecoder<ByteBuf> {
+
+    @Override
+    protected void decode(ChannelHandlerContext ctx, ByteBuf byteBuf, List<Object> list) {
+
+    }
+}

+ 74 - 0
evps-comm-local/src/main/java/com/evps/comm/local/xnet/client/codec/EvpsLocalClientEncoder.java

@@ -0,0 +1,74 @@
+package com.evps.comm.local.xnet.client.codec;
+
+import com.evps.comm.local.dto.CenterDto;
+import com.evps.comm.local.repository.ApplicationRepository;
+import com.its.common.network.NettyUtils;
+import io.netty.buffer.ByteBuf;
+import io.netty.channel.ChannelHandler;
+import io.netty.channel.ChannelHandlerContext;
+import io.netty.handler.codec.MessageToByteEncoder;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.slf4j.MDC;
+import org.springframework.stereotype.Component;
+
+@Slf4j
+@RequiredArgsConstructor
+@Component
+@ChannelHandler.Sharable
+public class EvpsLocalClientEncoder extends MessageToByteEncoder<Object> {
+
+    @Override
+    protected void encode(ChannelHandlerContext ctx, Object msg, ByteBuf outByteBuf) {
+        CenterDto center = ApplicationRepository.getCenterObject(ctx.channel());
+        if (center == null) {
+            log.error("SEND: [{}]. Not Found Channel Center Object... Oops Will be closed.", NettyUtils.getAddress(ctx.channel()));
+            ApplicationRepository.closeChannel(null, ctx.channel());
+            return;
+        }
+
+        MDC.put("id", center.getLogKey());
+
+//        if (!(msg instanceof C2CAuthenticatedMessage)) {
+//            log.info("SEND: [{}, {}], Unknown Send Object type {}.", center.getLogKey(), center.getIpAddress(), msg.getClass().getName());
+//            ApplicationRepository.closeChannel(center, ctx.channel());
+//            return;
+//        }
+//
+//        C2CAuthenticatedMessage c2c = (C2CAuthenticatedMessage)msg;
+//        try {
+//            ReverseByteArrayOutputStream c2cBuff = new ReverseByteArrayOutputStream(ItsAsn.ITS_ASN_PACKET_MAX_SIZE);
+//            ReverseByteArrayOutputStream pktBuff = new ReverseByteArrayOutputStream(ItsAsn.ITS_ASN_PACKET_MAX_SIZE);
+//            int length = c2c.encode(c2cBuff);
+//            if (length > 0) {
+//                DatexDataPacket dataPkt = new DatexDataPacket();
+//                dataPkt.setDatexVersionNumber(new BerEnum(ItsAsn.DATEX_VERSION_NUMBER_VERSION1));  // version == 1
+//                dataPkt.setDatexData(new BerOctetString(c2cBuff.getArray()));
+//                dataPkt.setDatexCrcNbr(new BerOctetString(ItsAsnCrc16.getCrc16ToByteArray(c2cBuff.getArray())));  // crc
+//
+//                dataPkt.encode(pktBuff);
+//                outByteBuf.writeBytes(pktBuff.getArray());
+//                center.getNetState().setLastSendTime();
+//                log.info("SEND: [{}, {}], {} Bytes.", center.getLogKey(), center.getIpAddress(), pktBuff.getArray().length);
+//                if (center.isCommLogging()) {
+//                    byte[] debugBytes = new byte[outByteBuf.readableBytes()];
+//                    outByteBuf.getBytes(outByteBuf.readerIndex(), debugBytes);
+//                    log.info("SEND: [{}, {}], {} Bytes. {}", center.getLogKey(), center.getIpAddress(), debugBytes.length, SysUtils.byteArrayToHex(debugBytes));
+//                }
+//            }
+//            else {
+//                log.error("SEND: [{}, {}]. C2CAuthenticatedMessage encode buffer length zero: will be closed.", center.getLogKey(), center.getIpAddress());
+//                ApplicationRepository.closeChannel(center, ctx.channel());
+//            }
+//        }
+//        catch (Exception e) {
+//            log.error("SEND: [{}, {}]. Exception Error: will be closed: {}.", center.getLogKey(), center.getIpAddress(), e.getMessage());
+//            if (center.getNetState().getState() != NET.TERMINATE) {
+//                ApplicationRepository.closeChannel(center, ctx.channel());
+//            }
+//        }
+
+        MDC.remove(center.getLogKey());
+        MDC.clear();
+    }
+}

+ 67 - 0
evps-comm-local/src/main/java/com/evps/comm/local/xnet/client/handler/EvpsLocalClientPacketInboundHandler.java

@@ -0,0 +1,67 @@
+package com.evps.comm.local.xnet.client.handler;
+
+import com.evps.comm.local.dto.CenterDto;
+import com.evps.comm.local.repository.ApplicationRepository;
+import com.its.common.network.NettyUtils;
+import io.netty.channel.ChannelHandler;
+import io.netty.channel.ChannelHandlerContext;
+import io.netty.channel.SimpleChannelInboundHandler;
+import io.netty.handler.timeout.IdleStateEvent;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+
+@Slf4j
+@RequiredArgsConstructor
+@Component
+@ChannelHandler.Sharable
+public class EvpsLocalClientPacketInboundHandler extends SimpleChannelInboundHandler<Object> {
+
+
+    @Override
+    protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
+        log.info("{} | Received Data.", NettyUtils.getRemoteAddress(ctx.channel()));
+    }
+
+    @Override
+    public void channelInactive(ChannelHandlerContext ctx) throws Exception {
+        CenterDto center = ApplicationRepository.getCenterObject(ctx.channel());
+        if (center == null) {
+            log.error("{}.userEventTriggered: Unknown Center: {}.", this.getClass().getSimpleName(), NettyUtils.getAddress(ctx.channel()));
+            return;
+        }
+        log.info("{}.++channelInactive: {}. {}.", this.getClass().getSimpleName(), center.getCenterId(), center.getIpAddress());
+        center.getNetState().disConnect();
+
+        ApplicationRepository.setCenterObject(ctx.channel(), null);
+        ctx.fireChannelInactive();
+    }
+
+    @Override
+    public void userEventTriggered(ChannelHandlerContext ctx, Object e) throws Exception {
+        CenterDto center = ApplicationRepository.getCenterObject(ctx.channel());
+        if (center == null) {
+            log.error("{}.userEventTriggered: Unknown Center: {}.", this.getClass().getSimpleName(), NettyUtils.getAddress(ctx.channel()));
+            return;
+        }
+
+        if (e instanceof IdleStateEvent) {
+            IdleStateEvent evt = (IdleStateEvent) e;
+        }
+        ctx.fireUserEventTriggered(e);
+    }
+
+    @Override
+    public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
+        CenterDto center = ApplicationRepository.getCenterObject(ctx.channel());
+        if (center != null) {
+            log.error("{}.exceptionCaught: {}.", this.getClass().getSimpleName(), center.getCenterId());
+        }
+        else {
+            log.error("{}.++exceptionCaught: {}.", this.getClass().getSimpleName(), NettyUtils.getAddress(ctx.channel()));
+        }
+
+        ctx.fireExceptionCaught(cause);
+        ctx.channel().close();
+    }
+}

+ 9 - 0
evps-comm-local/src/main/java/com/evps/comm/local/xnet/client/process/request/ReqEvpsLocalData.java

@@ -0,0 +1,9 @@
+package com.evps.comm.local.xnet.client.process.request;
+
+import io.netty.buffer.ByteBuf;
+
+public interface ReqEvpsLocalData {
+
+    String getMsgType();
+    ByteBuf getByteBuf();
+}

+ 24 - 0
evps-comm-local/src/main/java/com/evps/comm/local/xnet/client/process/request/ReqEvpsNetPing.java

@@ -0,0 +1,24 @@
+package com.evps.comm.local.xnet.client.process.request;
+
+import io.netty.buffer.ByteBuf;
+import lombok.Data;
+
+@Data
+public class ReqEvpsNetPing implements ReqEvpsLocalData {
+
+    private long sequence;
+
+    public ReqEvpsNetPing(long sequence) {
+        this.sequence = sequence;
+    }
+
+    @Override
+    public String getMsgType() {
+        return "EvpsNetPing";
+    }
+
+    public ByteBuf getByteBuf() {
+        return null;
+    }
+
+}

+ 48 - 0
evps-comm-local/src/main/resources/application.yml

@@ -0,0 +1,48 @@
+spring:
+  profiles:
+    active: prod
+  config:
+      import:
+        - optional:file:${user.dir}/conf/evps-comm-local.yml
+  application:
+    name: evps-comm-local
+  main:
+    web-application-type: none
+    log-startup-info: true
+    banner-mode: off
+  output:
+    ansi:
+      enabled: always
+  lifecycle:
+    timeout-per-shutdown-phase: 10s
+
+server:
+  port: 9872
+  shutdown: graceful
+management:
+  endpoints:
+    web:
+      exposure:
+        include: health, metrics
+
+application:
+  process-id: evps-comm-local
+  region-id: 183
+  server-ip: 10.4.4.51
+  server-port: 7800
+
+---
+spring:
+  config:
+    activate:
+      on-profile: dev
+application:
+  region-id: 186
+  server-ip: 192.168.20.44
+  server-port: 7800
+
+---
+spring:
+  config:
+    activate:
+      on-profile: prod

+ 2 - 0
evps-comm-local/src/main/resources/log4jdbc.log4j2.properties

@@ -0,0 +1,2 @@
+log4jdbc.spylogdelegator.name=net.sf.log4jdbc.log.slf4j.Slf4jSpyLogDelegator
+log4jdbc.dump.sql.maxlinelength=0

+ 41 - 0
evps-comm-local/src/main/resources/logback-spring-appender.xml

@@ -0,0 +1,41 @@
+<included>
+    <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+        <!--        <withJansi>true</withJansi>-->
+        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+            <charset>${LOG_CHARSET}</charset>
+            <pattern>${LOG_PATTERN_CONSOLE}</pattern>
+        </encoder>
+    </appender>
+
+    <appender name="FILE_LOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${LOG_PATH}${LOG_FILE_NAME}</file>
+        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+            <charset>${LOG_CHARSET}</charset>
+            <pattern>${LOG_PATTERN_FILE}</pattern>
+        </encoder>
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <fileNamePattern>${LOG_BACKUP_PATH}${LOG_FILE_NAME}.${LOG_FILE_NAME_BACKUP}</fileNamePattern>
+            <maxFileSize>${MAX_FILESIZE}</maxFileSize>
+            <maxHistory>${MAX_HISTORY}</maxHistory>
+        </rollingPolicy>
+    </appender>
+
+    <appender name="FILE_ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>error</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+        <file>${LOG_PATH}${LOG_FILE_NAME_ERROR}</file>
+        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+            <charset>${LOG_CHARSET}</charset>
+            <pattern>${LOG_PATTERN_ERROR}</pattern>
+        </encoder>
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <fileNamePattern>${LOG_BACKUP_PATH}${LOG_FILE_NAME_ERROR}.${LOG_FILE_NAME_BACKUP}</fileNamePattern>
+            <maxFileSize>${MAX_FILESIZE}</maxFileSize>
+            <maxHistory>${MAX_HISTORY}</maxHistory>
+        </rollingPolicy>
+    </appender>
+
+</included>

+ 49 - 0
evps-comm-local/src/main/resources/logback-spring.xml

@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration scan="true" scanPeriod="60 seconds">
+    <shutdownHook class="ch.qos.logback.core.hook.DelayingShutdownHook"/>
+
+    <property name="APP_CLASS_PATH"  value="com.evps.comm.local"/>
+    <property name="PROJECT_PREFIX"  value="evps-comm"/>
+    <property name="PROJECT_NAME"    value="${PROJECT_PREFIX}-local"/>
+    <property name="ROOT_LOG_LEVEL"  value="INFO"/>
+    <property name="LOG_CHARSET"     value="UTF-8" />
+    <property name="LOG_PATH"        value="${user.home}/logs/${PROJECT_NAME}/"/>
+    <property name="LOG_BACKUP_PATH" value="${user.home}/logs/${PROJECT_NAME}/backup/"/>
+
+    <property name="LOG_FILE_NAME"         value="${PROJECT_NAME}.log"/>
+    <property name="LOG_FILE_NAME_ERROR"   value="${PROJECT_NAME}.err.log"/>
+    <property name="LOG_FILE_NAME_BACKUP"  value="%d{yyyyMMdd}_%i.log.gz"/>
+    <property name="LOG_FILE_NAME_PACKET"  value="${PROJECT_PREFIX}-packet"/>
+
+    <property name="MAX_FILESIZE" value="10MB"/>
+    <property name="MAX_HISTORY"  value="10"/>
+    <property name="LOG_PATTERN_FILE"        value="[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%-5level] %msg%n"/>
+    <property name="LOG_PATTERN_ERROR"       value="[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%30t] [%5level] %42logger{35}.%-20M ${PID:-} %n%msg%n"/>
+    <property name="LOG_PATTERN_PACKET"      value="[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%-5level] %msg%n"/>
+    <property name="LOG_PATTERN_CONSOLE"     value="[%d{HH:mm:ss.SSS}] [%5level] %msg %n"/>
+
+    <springProfile name="!xxx">
+        <include resource="logback-spring-appender.xml"/>
+    </springProfile>
+
+    <root level="INFO">
+        <appender-ref ref="CONSOLE"/>
+        <appender-ref ref="FILE_LOG"/>
+        <appender-ref ref="FILE_ERROR"/>
+    </root>
+
+    <springProfile name="!prod">
+        <logger name="${APP_CLASS_PATH}" level="INFO" additivity="false">
+            <appender-ref ref="CONSOLE"/>
+            <appender-ref ref="FILE_LOG"/>
+            <appender-ref ref="FILE_ERROR"/>
+        </logger>
+    </springProfile>
+
+    <springProfile name="prod">
+        <logger name="${APP_CLASS_PATH}" level="INFO" additivity="false">
+            <appender-ref ref="FILE_LOG"/>
+            <appender-ref ref="FILE_ERROR"/>
+        </logger>
+    </springProfile>
+</configuration>

+ 14 - 0
evps-comm-server/src/main/resources/application.yml

@@ -77,6 +77,20 @@ spring:
       jdbc-url: jdbc:mariadb://10.4.4.20:3306/cvim_db?characterEncoding=UTF-8&serverTimezone=Asia/Seoul
       username: cvim
       password: 44Klctest$$
+---
+spring:
+  config:
+    activate:
+      on-profile: comp
+  datasource:
+    hikari:
+      driver-class-name: org.mariadb.jdbc.Driver
+      jdbc-url: jdbc:mariadb://115.91.94.42:13306/cvim_db?characterEncoding=UTF-8&serverTimezone=Asia/Seoul
+      username: cvim
+      password: 44Klctest$$
+application:
+  kafka:
+    bootstrap-servers: 61.82.138.91:19092
 
 ---
 spring:

+ 0 - 6
evps-kafka-producer/src/main/resources/application.yml

@@ -13,12 +13,6 @@ spring:
   output:
     ansi:
       enabled: always
-  datasource:
-    hikari:
-      connection-test-query: SELECT 1 FROM DUAL
-      minimumIdle: 5
-      maximumPoolSize: 20
-      idleTimeout: 30000
   lifecycle:
     timeout-per-shutdown-phase: 10s
 

+ 1 - 0
settings.gradle

@@ -3,4 +3,5 @@ include 'evps-common'
 include 'evps-comm-server'
 include 'evps-consumer'
 include 'evps-kafka-producer'
+include 'evps-comm-local'
 

Vissa filer visades inte eftersom för många filer har ändrats