Skip to content

Commit

Permalink
[FEAT] 실패한 이벤트를 재발행하는 스케줄러 Cron식 변경, 불필요한 스케줄러 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
JIN-076 committed Jun 24, 2024
1 parent 427adff commit d1a7f3f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void sendMessage(String topic, Event<?> event) {

// message is already committed in broker!
// if execution fail itself, re-publishing processed message,
// and then, consumer will verify duplication with redis cache!
// and then, consumer will verify duplication!
outboxTaskExecutor.execute(process(res));
}
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ public class OutboxProcessor {
private final OutboxJpaRepository outboxRepository;
private final MessageProducer messageProducer;

@Scheduled(cron = "0 30 23 * * *")
@Scheduled(cron = "0 0 2 * * *")
public void firstProcess() {

// 첫 번째 이벤트 발행부터 실패한 케이스에 대한 re-publishing
List<OutboxEvent> failedEvents = outboxRepository.findByStatusAndType(EventStatus.PENDING, EventType.ACHIEVEMENT);
republish(failedEvents, FIRST_TOPIC);
}

@Scheduled(cron = "0 0 0 * * *")
@Scheduled(cron = "0 0 3 * * *")
public void secondProcess() {

// 두 번째 이벤트 발행만 실패한 케이스에 대한 re-publishing
Expand Down

0 comments on commit d1a7f3f

Please sign in to comment.