mirror of
https://github.com/ktds-dg0501/kt-event-marketing.git
synced 2025-12-06 23:26:25 +00:00
Compare commits
No commits in common. "82086fcf64fe6730713ff360fe5fd2b6557645ed" and "a58d345f7b0d6d69af5e17ebb62bda10a5cc7d1e" have entirely different histories.
82086fcf64
...
a58d345f7b
12
.github/workflows/backend-cicd.yaml
vendored
12
.github/workflows/backend-cicd.yaml
vendored
@ -9,12 +9,12 @@ on:
|
|||||||
# - '*-service/**'
|
# - '*-service/**'
|
||||||
# - '.github/workflows/backend-cicd.yaml'
|
# - '.github/workflows/backend-cicd.yaml'
|
||||||
# - '.github/kustomize/**'
|
# - '.github/kustomize/**'
|
||||||
# pull_request:
|
pull_request:
|
||||||
# branches:
|
branches:
|
||||||
# - develop
|
- develop
|
||||||
# - main
|
- main
|
||||||
# paths:
|
paths:
|
||||||
# - '*-service/**'
|
- '*-service/**'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
@ -7,9 +7,6 @@ RUN java -Djarmode=layertools -jar app.jar extract
|
|||||||
FROM eclipse-temurin:21-jre-alpine
|
FROM eclipse-temurin:21-jre-alpine
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install gcompat for Snappy compression library compatibility
|
|
||||||
RUN apk add --no-cache gcompat
|
|
||||||
|
|
||||||
# Create non-root user
|
# Create non-root user
|
||||||
RUN addgroup -S spring && adduser -S spring -G spring
|
RUN addgroup -S spring && adduser -S spring -G spring
|
||||||
USER spring:spring
|
USER spring:spring
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||||
import org.springframework.data.redis.connection.RedisSentinelConfiguration;
|
import org.springframework.data.redis.connection.RedisStandaloneConfiguration;
|
||||||
import org.springframework.data.redis.connection.lettuce.LettuceClientConfiguration;
|
import org.springframework.data.redis.connection.lettuce.LettuceClientConfiguration;
|
||||||
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
|
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
|
||||||
import org.springframework.data.redis.core.RedisTemplate;
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
@ -17,7 +17,6 @@ import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSeriali
|
|||||||
import org.springframework.data.redis.serializer.StringRedisSerializer;
|
import org.springframework.data.redis.serializer.StringRedisSerializer;
|
||||||
|
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Redis 설정
|
* Redis 설정
|
||||||
@ -30,11 +29,11 @@ import java.util.Arrays;
|
|||||||
@Configuration
|
@Configuration
|
||||||
public class RedisConfig {
|
public class RedisConfig {
|
||||||
|
|
||||||
@Value("${spring.data.redis.sentinel.master:mymaster}")
|
@Value("${spring.data.redis.host}")
|
||||||
private String sentinelMaster;
|
private String redisHost;
|
||||||
|
|
||||||
@Value("${spring.data.redis.sentinel.nodes}")
|
@Value("${spring.data.redis.port}")
|
||||||
private String sentinelNodes;
|
private int redisPort;
|
||||||
|
|
||||||
@Value("${spring.data.redis.password}")
|
@Value("${spring.data.redis.password}")
|
||||||
private String redisPassword;
|
private String redisPassword;
|
||||||
@ -46,26 +45,17 @@ public class RedisConfig {
|
|||||||
private long redisTimeout;
|
private long redisTimeout;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Redis 연결 팩토리 설정 (Sentinel 모드)
|
* Redis 연결 팩토리 설정
|
||||||
*/
|
*/
|
||||||
@Bean
|
@Bean
|
||||||
public RedisConnectionFactory redisConnectionFactory() {
|
public RedisConnectionFactory redisConnectionFactory() {
|
||||||
RedisSentinelConfiguration sentinelConfig = new RedisSentinelConfiguration()
|
RedisStandaloneConfiguration config = new RedisStandaloneConfiguration();
|
||||||
.master(sentinelMaster);
|
config.setHostName(redisHost);
|
||||||
|
config.setPort(redisPort);
|
||||||
// Sentinel 노드 추가 (콤마로 구분된 host:port 형식)
|
|
||||||
Arrays.stream(sentinelNodes.split(","))
|
|
||||||
.map(String::trim)
|
|
||||||
.forEach(node -> {
|
|
||||||
String[] parts = node.split(":");
|
|
||||||
sentinelConfig.sentinel(parts[0], Integer.parseInt(parts[1]));
|
|
||||||
});
|
|
||||||
|
|
||||||
if (redisPassword != null && !redisPassword.isEmpty()) {
|
if (redisPassword != null && !redisPassword.isEmpty()) {
|
||||||
sentinelConfig.setPassword(redisPassword);
|
config.setPassword(redisPassword);
|
||||||
sentinelConfig.setSentinelPassword(redisPassword);
|
|
||||||
}
|
}
|
||||||
sentinelConfig.setDatabase(redisDatabase);
|
config.setDatabase(redisDatabase);
|
||||||
|
|
||||||
// Lettuce Client 설정: Timeout 및 Connection 옵션
|
// Lettuce Client 설정: Timeout 및 Connection 옵션
|
||||||
SocketOptions socketOptions = SocketOptions.builder()
|
SocketOptions socketOptions = SocketOptions.builder()
|
||||||
@ -83,7 +73,8 @@ public class RedisConfig {
|
|||||||
.clientOptions(clientOptions)
|
.clientOptions(clientOptions)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
return new LettuceConnectionFactory(sentinelConfig, clientConfig);
|
// afterPropertiesSet() 제거: Spring이 자동으로 호출함
|
||||||
|
return new LettuceConnectionFactory(config, clientConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -25,11 +25,6 @@ public class AIJobMessage {
|
|||||||
*/
|
*/
|
||||||
private String jobId;
|
private String jobId;
|
||||||
|
|
||||||
/**
|
|
||||||
* 사용자 ID (UUID String)
|
|
||||||
*/
|
|
||||||
private String userId;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 이벤트 ID (Event Service에서 생성)
|
* 이벤트 ID (Event Service에서 생성)
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -2,16 +2,14 @@ spring:
|
|||||||
application:
|
application:
|
||||||
name: ai-service
|
name: ai-service
|
||||||
|
|
||||||
# Redis Configuration with Sentinel
|
# Redis Configuration
|
||||||
data:
|
data:
|
||||||
redis:
|
redis:
|
||||||
|
host: ${REDIS_HOST:20.214.210.71}
|
||||||
|
port: ${REDIS_PORT:6379}
|
||||||
password: ${REDIS_PASSWORD:Hi5Jessica!}
|
password: ${REDIS_PASSWORD:Hi5Jessica!}
|
||||||
database: ${REDIS_DATABASE:3}
|
database: ${REDIS_DATABASE:3}
|
||||||
timeout: ${REDIS_TIMEOUT:3000}
|
timeout: ${REDIS_TIMEOUT:3000}
|
||||||
sentinel:
|
|
||||||
master: ${REDIS_SENTINEL_MASTER:mymaster}
|
|
||||||
nodes: ${REDIS_SENTINEL_NODES:redis-node-0.redis-headless.kt-event-marketing.svc.cluster.local:26379,redis-node-1.redis-headless.kt-event-marketing.svc.cluster.local:26379}
|
|
||||||
password: ${REDIS_PASSWORD:Hi5Jessica!}
|
|
||||||
lettuce:
|
lettuce:
|
||||||
pool:
|
pool:
|
||||||
max-active: ${REDIS_POOL_MAX:8}
|
max-active: ${REDIS_POOL_MAX:8}
|
||||||
|
|||||||
@ -30,40 +30,7 @@ spec:
|
|||||||
port:
|
port:
|
||||||
number: 80
|
number: 80
|
||||||
|
|
||||||
# Event Service - Swagger UI (must be before /api/v1/events path)
|
# Event Service
|
||||||
- path: /api/v1/swagger-ui
|
|
||||||
pathType: Prefix
|
|
||||||
backend:
|
|
||||||
service:
|
|
||||||
name: event-service
|
|
||||||
port:
|
|
||||||
number: 80
|
|
||||||
|
|
||||||
- path: /api/v1/swagger-ui.html
|
|
||||||
pathType: Prefix
|
|
||||||
backend:
|
|
||||||
service:
|
|
||||||
name: event-service
|
|
||||||
port:
|
|
||||||
number: 80
|
|
||||||
|
|
||||||
- path: /api/v1/v3/api-docs
|
|
||||||
pathType: Prefix
|
|
||||||
backend:
|
|
||||||
service:
|
|
||||||
name: event-service
|
|
||||||
port:
|
|
||||||
number: 80
|
|
||||||
|
|
||||||
- path: /api/v1/api-docs
|
|
||||||
pathType: Prefix
|
|
||||||
backend:
|
|
||||||
service:
|
|
||||||
name: event-service
|
|
||||||
port:
|
|
||||||
number: 80
|
|
||||||
|
|
||||||
# Event Service - API endpoints
|
|
||||||
- path: /api/v1/events
|
- path: /api/v1/events
|
||||||
pathType: Prefix
|
pathType: Prefix
|
||||||
backend:
|
backend:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user