Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package app.handong.cms.listener;


import app.handong.cms.service.NodeService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.context.annotation.Bean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.amqp.core.Queue;
import org.springframework.stereotype.Component;

@Slf4j
Expand All @@ -18,11 +20,14 @@ public class TranscodeStatusListener {
public void handleTranscodeStatus(TranscodeStatusMessage message) {
try {
log.info("📡⚡️ 트랜스코딩 상태 메시지 수신 - videoId: {}, status: {}, progress: {}", message.getVideoId(), message.getStatus(), message.getProgress());

nodeService.updateVideoTranscodeStatus(message.getVideoId(), message.getStatus(), message.getProgress());

} catch (Exception e) {
log.error("❌ 트랜스코딩 상태 메시지 처리 실패", e);
}
}

@Bean
public Queue transcodeStatusQueue(@Value("${rabbitmq.queue.transcode-status}") String name) {
return new Queue(name, true);
}
}
8 changes: 8 additions & 0 deletions src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ spring:
port: ${RABBITMQ_PORT}
username: ${RABBITMQ_USERNAME}
password: ${RABBITMQ_PASSWORD}
listener:
simple:
missing-queues-fatal: false
retry:
enabled: true # (선택) 연결 재시도 활성화
initial-interval: 2000ms
max-attempts: 5
multiplier: 2.0

cloud:
aws:
Expand Down