mirror of
https://github.com/ktds-dg0501/kt-event-marketing.git
synced 2026-06-13 01:49:10 +00:00
Event Service 백엔드 테스트 완료
- 백엔드 API 테스트 완료 (8/8 성공) - Redis, PostgreSQL, Kafka 연동 검증 - ErrorHandlingDeserializer를 통한 Kafka Consumer 안정화 - 테스트 결과 보고서 작성 (develop/dev/test-backend.md) - 실행 프로파일 추가 (event-service/.run/) - 설정 일치 검증 완료 (application.yml ↔ run.xml)
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="event-service" type="GradleRunConfiguration" factoryName="Gradle">
|
||||
<ExternalSystemSettings>
|
||||
<option name="env">
|
||||
<map>
|
||||
<!-- Server Configuration -->
|
||||
<entry key="SERVER_PORT" value="8080" />
|
||||
|
||||
<!-- Database Configuration -->
|
||||
<entry key="DB_HOST" value="20.249.177.232" />
|
||||
<entry key="DB_PORT" value="5432" />
|
||||
<entry key="DB_NAME" value="eventdb" />
|
||||
<entry key="DB_USERNAME" value="eventuser" />
|
||||
<entry key="DB_PASSWORD" value="Hi5Jessica!" />
|
||||
|
||||
<!-- JPA Configuration -->
|
||||
<entry key="DDL_AUTO" value="update" />
|
||||
|
||||
<!-- Redis Configuration -->
|
||||
<entry key="REDIS_HOST" value="20.214.210.71" />
|
||||
<entry key="REDIS_PORT" value="6379" />
|
||||
<entry key="REDIS_PASSWORD" value="Hi5Jessica!" />
|
||||
|
||||
<!-- Kafka Configuration -->
|
||||
<entry key="KAFKA_BOOTSTRAP_SERVERS" value="20.249.182.13:9095,4.217.131.59:9095" />
|
||||
|
||||
<!-- Service URLs -->
|
||||
<entry key="CONTENT_SERVICE_URL" value="http://localhost:8082" />
|
||||
<entry key="DISTRIBUTION_SERVICE_URL" value="http://localhost:8084" />
|
||||
|
||||
<!-- JWT Configuration -->
|
||||
<entry key="JWT_SECRET" value="kt-event-marketing-secret-key-for-development-only-please-change-in-production" />
|
||||
|
||||
<!-- Logging Configuration -->
|
||||
<entry key="LOG_LEVEL" value="DEBUG" />
|
||||
<entry key="SQL_LOG_LEVEL" value="DEBUG" />
|
||||
</map>
|
||||
</option>
|
||||
<option name="executionName" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="externalSystemIdString" value="GRADLE" />
|
||||
<option name="scriptParameters" value="" />
|
||||
<option name="taskDescriptions">
|
||||
<list />
|
||||
</option>
|
||||
<option name="taskNames">
|
||||
<list>
|
||||
<option value="event-service:bootRun" />
|
||||
</list>
|
||||
</option>
|
||||
<option name="vmOptions" value="-Xms512m -Xmx2048m -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=512m -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -Dspring.jmx.enabled=false -Dspring.devtools.restart.enabled=false" />
|
||||
</ExternalSystemSettings>
|
||||
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
|
||||
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
|
||||
<EXTENSION ID="com.intellij.execution.ExternalSystemRunConfigurationJavaExtension">
|
||||
<extension name="net.ashald.envfile">
|
||||
<option name="IS_ENABLED" value="false" />
|
||||
<option name="IS_SUBST" value="false" />
|
||||
<option name="IS_PATH_MACRO_SUPPORTED" value="false" />
|
||||
<option name="IS_IGNORE_MISSING_FILES" value="false" />
|
||||
<option name="IS_ENABLE_EXPERIMENTAL_INTEGRATIONS" value="false" />
|
||||
<ENTRIES>
|
||||
<ENTRY IS_ENABLED="true" PARSER="runconfig" IS_EXECUTABLE="false" />
|
||||
</ENTRIES>
|
||||
</extension>
|
||||
</EXTENSION>
|
||||
<DebugAllEnabled>false</DebugAllEnabled>
|
||||
<RunAsTest>false</RunAsTest>
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
@@ -11,6 +11,7 @@ import org.springframework.kafka.annotation.EnableKafka;
|
||||
import org.springframework.kafka.config.ConcurrentKafkaListenerContainerFactory;
|
||||
import org.springframework.kafka.core.*;
|
||||
import org.springframework.kafka.listener.ContainerProperties;
|
||||
import org.springframework.kafka.support.serializer.ErrorHandlingDeserializer;
|
||||
import org.springframework.kafka.support.serializer.JsonDeserializer;
|
||||
import org.springframework.kafka.support.serializer.JsonSerializer;
|
||||
|
||||
@@ -68,6 +69,7 @@ public class KafkaConfig {
|
||||
|
||||
/**
|
||||
* Kafka Consumer 설정
|
||||
* ErrorHandlingDeserializer를 사용하여 역직렬화 오류를 처리합니다.
|
||||
*
|
||||
* @return ConsumerFactory 인스턴스
|
||||
*/
|
||||
@@ -76,10 +78,20 @@ public class KafkaConfig {
|
||||
Map<String, Object> config = new HashMap<>();
|
||||
config.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);
|
||||
config.put(ConsumerConfig.GROUP_ID_CONFIG, consumerGroupId);
|
||||
config.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);
|
||||
config.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, JsonDeserializer.class);
|
||||
|
||||
// ErrorHandlingDeserializer로 래핑하여 역직렬화 오류 처리
|
||||
config.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, ErrorHandlingDeserializer.class);
|
||||
config.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, ErrorHandlingDeserializer.class);
|
||||
|
||||
// 실제 Deserializer 설정
|
||||
config.put(ErrorHandlingDeserializer.KEY_DESERIALIZER_CLASS, StringDeserializer.class);
|
||||
config.put(ErrorHandlingDeserializer.VALUE_DESERIALIZER_CLASS, JsonDeserializer.class);
|
||||
|
||||
// JsonDeserializer 설정
|
||||
config.put(JsonDeserializer.TRUSTED_PACKAGES, "*");
|
||||
config.put(JsonDeserializer.USE_TYPE_INFO_HEADERS, false);
|
||||
config.put(JsonDeserializer.VALUE_DEFAULT_TYPE, "java.util.HashMap");
|
||||
|
||||
config.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");
|
||||
config.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, false);
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@ spring:
|
||||
password: ${DB_PASSWORD:eventpass}
|
||||
driver-class-name: org.postgresql.Driver
|
||||
hikari:
|
||||
maximum-pool-size: 10
|
||||
minimum-idle: 5
|
||||
maximum-pool-size: 5
|
||||
minimum-idle: 2
|
||||
connection-timeout: 30000
|
||||
idle-timeout: 600000
|
||||
max-lifetime: 1800000
|
||||
@@ -22,9 +22,9 @@ spring:
|
||||
ddl-auto: ${DDL_AUTO:update}
|
||||
properties:
|
||||
hibernate:
|
||||
format_sql: true
|
||||
format_sql: false
|
||||
show_sql: false
|
||||
use_sql_comments: true
|
||||
use_sql_comments: false
|
||||
jdbc:
|
||||
batch_size: 20
|
||||
time_zone: Asia/Seoul
|
||||
@@ -40,9 +40,9 @@ spring:
|
||||
connect-timeout: 60000ms
|
||||
lettuce:
|
||||
pool:
|
||||
max-active: 10
|
||||
max-idle: 5
|
||||
min-idle: 2
|
||||
max-active: 5
|
||||
max-idle: 3
|
||||
min-idle: 1
|
||||
max-wait: -1ms
|
||||
shutdown-timeout: 200ms
|
||||
|
||||
@@ -96,15 +96,22 @@ management:
|
||||
logging:
|
||||
level:
|
||||
root: INFO
|
||||
com.kt.event: ${LOG_LEVEL:DEBUG}
|
||||
org.springframework: INFO
|
||||
org.springframework.data.redis: DEBUG
|
||||
io.lettuce.core: DEBUG
|
||||
org.hibernate.SQL: ${SQL_LOG_LEVEL:DEBUG}
|
||||
org.hibernate.type.descriptor.sql.BasicBinder: TRACE
|
||||
com.kt.event: ${LOG_LEVEL:INFO}
|
||||
org.springframework: WARN
|
||||
org.springframework.data.redis: WARN
|
||||
io.lettuce.core: WARN
|
||||
org.hibernate.SQL: ${SQL_LOG_LEVEL:WARN}
|
||||
org.hibernate.type.descriptor.sql.BasicBinder: WARN
|
||||
pattern:
|
||||
console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"
|
||||
file: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"
|
||||
file:
|
||||
name: ${LOG_FILE:logs/event-service.log}
|
||||
logback:
|
||||
rollingpolicy:
|
||||
max-file-size: 10MB
|
||||
max-history: 7
|
||||
total-size-cap: 100MB
|
||||
|
||||
# Springdoc OpenAPI Configuration
|
||||
springdoc:
|
||||
|
||||
Reference in New Issue
Block a user