package com.gyee.edge.gateway;

import com.gyee.edge.gateway.bridge.rocketmq.producter.AsyncProducter;
import com.gyee.edge.gateway.config.cache.PointCache;
import com.gyee.edge.gateway.config.read.ReadPoint102SqliteData;
import com.gyee.edge.gateway.config.read.ReadPointSqLiteData;
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 ApplicationEventListener implements
        ApplicationListener<ApplicationReadyEvent> {

    @Autowired
    private AsyncProducter asyncProducter;
    @SneakyThrows
    @Override
    public void onApplicationEvent(ApplicationReadyEvent event) {
        log.info("ApplicationEvent  rised!");
        log.info("listener: " + event.toString());

        asyncProducter.dataSendProducter();
    }

}