package com.fdkankan.disruptormq;

import com.lmax.disruptor.ExceptionHandler;
import lombok.extern.slf4j.Slf4j;

/**
 * @author Xiewj
 * @date 2024/1/17
 */
@Slf4j
public class DisruptorExcepitonHandler<T> implements ExceptionHandler<T> {
    @Override
    public void handleEventException(Throwable ex, long sequence, T event) {
        log.error("DisruptorEvent Handle处理错误，sequence={}，event={}，e={}", sequence, event.toString(), ex.toString(), ex);
    }

    @Override
    public void handleOnStartException(Throwable ex) {
        log.error("DisruptorEvent handleOnStart处理错误，e={}", ex.toString(), ex);
    }

    @Override
    public void handleOnShutdownException(Throwable ex) {
        log.error("DisruptorEvent handleOnShutdown处理错误，e={}", ex.toString(), ex);
    }
}