mirror of
https://github.com/ktds-dg0501/kt-event-marketing.git
synced 2025-12-06 18:06:23 +00:00
주요 변경사항:
- User-level Analytics API 기간 파라미터 제거 (전체 기간 자동 계산)
* /api/v1/users/{userId}/analytics/dashboard
* /api/v1/users/{userId}/analytics/channels
* /api/v1/users/{userId}/analytics/roi
* /api/v1/users/{userId}/analytics/timeline
- Kafka Consumer 안정성 개선
* Consumer Group ID를 analytics-service-consumers-v3로 변경
* Redis 멱등성 키 v2 버전 사용 (processed_events_v2, distribution_completed_v2, processed_participants_v2)
* ParticipantRegisteredConsumer 멱등성 키를 eventId:participantId 조합으로 변경하여 중복 방지 강화
- 설정 개선
* UTF-8 인코딩 명시적 설정 추가
* Kafka auto.offset.reset 설정 명확화
- 테스트 도구 추가
* tools/reset-analytics-data.ps1: 테스트 데이터 초기화 스크립트
* DebugController: 개발 환경 디버깅용 엔드포인트
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
34 lines
1.3 KiB
PowerShell
34 lines
1.3 KiB
PowerShell
# Analytics Redis 초기화 스크립트
|
|
|
|
Write-Host "Analytics Redis 초기화 시작..." -ForegroundColor Cyan
|
|
|
|
# Redis 컨테이너 찾기
|
|
$redisContainer = docker ps --filter "ancestor=redis" --format "{{.Names}}" | Select-Object -First 1
|
|
|
|
if ($redisContainer) {
|
|
Write-Host "Redis 컨테이너 발견: $redisContainer" -ForegroundColor Green
|
|
|
|
# 멱등성 키 삭제
|
|
Write-Host "멱등성 키 삭제 중..." -ForegroundColor Yellow
|
|
docker exec $redisContainer redis-cli DEL processed_participants
|
|
docker exec $redisContainer redis-cli DEL processed_events
|
|
docker exec $redisContainer redis-cli DEL distribution_completed
|
|
|
|
# 캐시 삭제
|
|
Write-Host "Analytics 캐시 삭제 중..." -ForegroundColor Yellow
|
|
docker exec $redisContainer redis-cli --scan --pattern "analytics:*" | ForEach-Object {
|
|
docker exec $redisContainer redis-cli DEL $_
|
|
}
|
|
|
|
Write-Host "완료! 서버를 재시작해주세요." -ForegroundColor Green
|
|
} else {
|
|
Write-Host "Redis 컨테이너를 찾을 수 없습니다." -ForegroundColor Red
|
|
Write-Host "로컬 Redis를 시도합니다..." -ForegroundColor Yellow
|
|
|
|
redis-cli DEL processed_participants
|
|
redis-cli DEL processed_events
|
|
redis-cli DEL distribution_completed
|
|
|
|
Write-Host "완료! 서버를 재시작해주세요." -ForegroundColor Green
|
|
}
|