package com.unicorn.hgzero.stt.config;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Azure Event Hub 설정
 * 이벤트 발행/소비를 위한 설정
 */
@Configuration
public class EventHubConfig {
    
    /**
     * JSON 직렬화/역직렬화를 위한 ObjectMapper
     */
    @Bean
    public ObjectMapper objectMapper() {
        ObjectMapper mapper = new ObjectMapper();
        mapper.registerModule(new JavaTimeModule());
        return mapper;
    }
    
    /**
     * Azure Event Hub Producer 설정
     * 실제 운영 환경에서는 Azure Event Hubs SDK 설정
     */
    // @Bean
    // public EventHubProducerClient eventHubProducerClient() {
    //     return new EventHubClientBuilder()
    //             .connectionString(connectionString)
    //             .buildProducerClient();
    // }
    
    /**
     * Azure Event Hub Consumer 설정
     * 실제 운영 환경에서는 Azure Event Hubs SDK 설정
     */
    // @Bean
    // public EventProcessorClient eventProcessorClient() {
    //     return new EventProcessorClientBuilder()
    //             .connectionString(connectionString)
    //             .consumerGroup(consumerGroup)
    //             .processEvent(this::processEvent)
    //             .processError(this::processError)
    //             .buildEventProcessorClient();
    // }
}