mirror of
https://github.com/hwanny1128/HGZero.git
synced 2026-06-12 22:59:10 +00:00
notification 실행환경 설정
This commit is contained in:
@@ -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 -->
|
||||
|
||||
+2749
-1855
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user