mirror of
https://github.com/hwanny1128/HGZero.git
synced 2026-06-13 09:29:10 +00:00
meeting 및 notification 실행환경 설정
This commit is contained in:
+1
-1
@@ -129,7 +129,7 @@ public class NotificationResponse {
|
||||
@Schema(description = "발송 일시", example = "2025-01-23T10:05:00")
|
||||
private LocalDateTime sentAt;
|
||||
|
||||
@Schema(description = "실패 사유", example = null)
|
||||
@Schema(description = "실패 사유", example = "")
|
||||
private String errorMessage;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.unicorn.hgzero.notification.event;
|
||||
|
||||
import com.azure.messaging.eventhubs.models.EventContext;
|
||||
import com.azure.messaging.eventhubs.models.EventData;
|
||||
import com.azure.messaging.eventhubs.models.PartitionEvent;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.unicorn.hgzero.notification.event.event.MeetingCreatedEvent;
|
||||
import com.unicorn.hgzero.notification.event.event.TodoAssignedEvent;
|
||||
@@ -27,7 +26,7 @@ import java.util.function.Consumer;
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class EventHandler implements Consumer<EventContext> {
|
||||
public class EventHandler implements Consumer<PartitionEvent> {
|
||||
|
||||
private final NotificationService notificationService;
|
||||
private final ObjectMapper objectMapper;
|
||||
@@ -36,13 +35,14 @@ public class EventHandler implements Consumer<EventContext> {
|
||||
/**
|
||||
* Event Hub 이벤트 처리
|
||||
*
|
||||
* @param eventContext Event Hub 이벤트 컨텍스트
|
||||
* @param partitionEvent Event Hub 파티션 이벤트
|
||||
*/
|
||||
@Override
|
||||
public void accept(EventContext eventContext) {
|
||||
EventData eventData = eventContext.getEventData();
|
||||
|
||||
public void accept(PartitionEvent partitionEvent) {
|
||||
try {
|
||||
// 이벤트 데이터 추출
|
||||
var eventData = partitionEvent.getData();
|
||||
|
||||
// 이벤트 속성 추출
|
||||
Map<String, Object> properties = eventData.getProperties();
|
||||
String topic = (String) properties.get("topic");
|
||||
@@ -63,8 +63,9 @@ public class EventHandler implements Consumer<EventContext> {
|
||||
}
|
||||
|
||||
// 체크포인트 업데이트 (처리 성공 시)
|
||||
eventContext.updateCheckpoint();
|
||||
log.info("이벤트 처리 완료 및 체크포인트 업데이트");
|
||||
// TODO: Azure Event Hubs 5.x API에 맞게 체크포인트 업데이트 구현 필요
|
||||
// partitionEvent.getPartitionContext().updateCheckpointAsync().block();
|
||||
log.info("이벤트 처리 완료");
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("이벤트 처리 중 오류 발생", e);
|
||||
|
||||
Reference in New Issue
Block a user