package com.mes.job; import com.mes.milo.runner.subscription.SubscriptionCallback; import com.mes.milo.service.MiloService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import java.util.Arrays; /** * @Author : zhoush * @Date: 2024/10/10 8:05 * @Description: */ @Component @Slf4j public class OpcCacheGlassTask { @Autowired MiloService miloService; @Autowired SubscriptionCallback cacheGlassSubscriptionCallback; @Scheduled(fixedDelay = Long.MAX_VALUE) public void startOpcTask() throws Exception { miloService.subscriptionFromOpcUa(Arrays.asList("my.device.x1", "my.device.x2"), cacheGlassSubscriptionCallback); } }