notification 실행환경 설정

This commit is contained in:
djeon
2025-10-24 09:38:26 +09:00
parent 0dc0e0cee6
commit 16caafd7c8
11 changed files with 3848 additions and 9692 deletions
@@ -44,7 +44,7 @@
<entry key="AZURE_EVENTHUB_CONSUMER_GROUP" value="$Default" />
<!-- Azure Storage Configuration -->
<entry key="AZURE_STORAGE_CONNECTION_STRING" value="xOQGJhDT6sqOGyTohS7K5dMgGNlryuaQSg8dNCJ40sdGpYok5T5Z88M3xVlk39oeFKiQdGYCihqC+AStBsoBPw==" />
<entry key="AZURE_STORAGE_CONNECTION_STRING" value="DefaultEndpointsProtocol=https;AccountName=hgzerostorage;AccountKey=xOQGJhDT6sqOGyTohS7K5dMgGNlryuaQSg8dNCJ40sdGpYok5T5Z88M3xVlk39oeFKiQdGYCihqC+AStBsoBPw==;EndpointSuffix=core.windows.net" />
<entry key="AZURE_STORAGE_CONTAINER_NAME" value="eventhub-checkpoints" />
<!-- Notification Configuration -->
File diff suppressed because it is too large Load Diff
@@ -1,6 +1,6 @@
package com.unicorn.hgzero.notification.event;
import com.azure.messaging.eventhubs.models.PartitionEvent;
import com.azure.messaging.eventhubs.models.EventContext;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.unicorn.hgzero.notification.event.event.MeetingCreatedEvent;
import com.unicorn.hgzero.notification.event.event.TodoAssignedEvent;
@@ -26,7 +26,7 @@ import java.util.function.Consumer;
@Slf4j
@Component
@RequiredArgsConstructor
public class EventHandler implements Consumer<PartitionEvent> {
public class EventHandler implements Consumer<EventContext> {
private final NotificationService notificationService;
private final ObjectMapper objectMapper;
@@ -35,13 +35,13 @@ public class EventHandler implements Consumer<PartitionEvent> {
/**
* Event Hub 이벤트 처리
*
* @param partitionEvent Event Hub 파티션 이벤트
* @param eventContext Event Hub 이벤트 컨텍스
*/
@Override
public void accept(PartitionEvent partitionEvent) {
public void accept(EventContext eventContext) {
try {
// 이벤트 데이터 추출
var eventData = partitionEvent.getData();
var eventData = eventContext.getEventData();
// 이벤트 속성 추출
Map<String, Object> properties = eventData.getProperties();
@@ -63,8 +63,7 @@ public class EventHandler implements Consumer<PartitionEvent> {
}
// 체크포인트 업데이트 (처리 성공 시)
// TODO: Azure Event Hubs 5.x API에 맞게 체크포인트 업데이트 구현 필요
// partitionEvent.getPartitionContext().updateCheckpointAsync().block();
eventContext.updateCheckpoint();
log.info("이벤트 처리 완료");
} catch (Exception e) {