package com.elab.spring.utils;

import com.alibaba.fastjson.JSON;
import com.elab.spring.utils.event.EventA;
import org.springframework.context.ApplicationListener;
import org.springframework.core.Ordered;

public class SourceApplicationListener implements ApplicationListener<EventA>, Ordered {

    @Override
    public int getOrder() {
        return 0;  // 数值越低优先级越高
    }

    @Override
    public void onApplicationEvent(EventA event) {
        System.out.println("SourceApplicationListener 消费到: " + JSON.toJSONString(event.getSource()));
    }
}
