提交 7d53a11c authored 作者: yangli's avatar yangli

.

上级 0c25e290
package com.priusis;
import com.priusis.client.service.TenantManagerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import javax.annotation.Resource;
@Slf4j
@EnableScheduling
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, SecurityAutoConfiguration.class})
public class ApqClientApplication {
......@@ -14,4 +20,17 @@ public class ApqClientApplication {
SpringApplication.run(ApqClientApplication.class, args);
}
@Resource
private TenantManagerService service;
@Scheduled(fixedDelay = 60000)
protected void heartbeatJob() {
try {
service.processRequest("oc-client", "{\"heartbeat\":1}");
} catch (Exception e) {
log.error("发送心跳异常", e);
}
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论