package com.gyee.edge.loader;

import com.gyee.edge.loader.adapter.DataWrite;
import com.gyee.edge.loader.rocketmq.comuser.BalanceComuser;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class ApplicationConsumerEventListener implements
        ApplicationListener<ApplicationReadyEvent> {

    @Autowired
    private BalanceComuser balanceComuser;



    @SneakyThrows
    @Override
    public void onApplicationEvent(ApplicationReadyEvent event) {
        log.info("ApplicationEvent  rised!");
        log.info("listener: " + event.toString());
        balanceComuser.DataConsumer();
    }

}