kt-event-marketing/tools/check-kafka-messages.ps1
doyeon b198c46d06 Analytics 서비스 및 보안 기능 업데이트
- Analytics 서비스 구현 추가 (API, 소스 코드)
- Event 서비스 소스 코드 추가
- 보안 관련 공통 컴포넌트 업데이트 (JWT, UserPrincipal, ErrorCode)
- API 컨벤션 및 명세서 업데이트
- 데이터베이스 SQL 스크립트 추가
- 백엔드 개발 문서 및 테스트 가이드 추가
- Kafka 메시지 체크 도구 추가

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-27 16:11:00 +09:00

64 lines
2.1 KiB
PowerShell

# Kafka 메시지 확인 스크립트 (Windows PowerShell)
#
# 사용법: .\check-kafka-messages.ps1
$KAFKA_SERVER = "4.230.50.63:9092"
Write-Host "========================================" -ForegroundColor Cyan
Write-Host "📊 Kafka 토픽 메시지 확인" -ForegroundColor Cyan
Write-Host "========================================" -ForegroundColor Cyan
Write-Host ""
# Kafka 설치 확인
$kafkaPath = Read-Host "Kafka 설치 경로를 입력하세요 (예: C:\kafka)"
if (-not (Test-Path "$kafkaPath\bin\windows\kafka-console-consumer.bat")) {
Write-Host "❌ Kafka가 해당 경로에 설치되어 있지 않습니다." -ForegroundColor Red
exit 1
}
Write-Host "✅ Kafka 경로 확인: $kafkaPath" -ForegroundColor Green
Write-Host ""
# 토픽 선택
Write-Host "확인할 토픽을 선택하세요:" -ForegroundColor Yellow
Write-Host " 1. event.created (이벤트 생성)"
Write-Host " 2. participant.registered (참여자 등록)"
Write-Host " 3. distribution.completed (배포 완료)"
Write-Host " 4. 모두 확인"
Write-Host ""
$choice = Read-Host "선택 (1-4)"
$topics = @()
switch ($choice) {
"1" { $topics = @("event.created") }
"2" { $topics = @("participant.registered") }
"3" { $topics = @("distribution.completed") }
"4" { $topics = @("event.created", "participant.registered", "distribution.completed") }
default {
Write-Host "❌ 잘못된 선택입니다." -ForegroundColor Red
exit 1
}
}
# 각 토픽별 메시지 확인
foreach ($topic in $topics) {
Write-Host ""
Write-Host "========================================" -ForegroundColor Cyan
Write-Host "📩 토픽: $topic" -ForegroundColor Cyan
Write-Host "========================================" -ForegroundColor Cyan
# 최근 5개 메시지만 확인
& "$kafkaPath\bin\windows\kafka-console-consumer.bat" `
--bootstrap-server $KAFKA_SERVER `
--topic $topic `
--from-beginning `
--max-messages 5 `
--timeout-ms 5000 2>&1 | Out-String | Write-Host
Write-Host ""
}
Write-Host "✅ 확인 완료!" -ForegroundColor Green