黄昏孤酒

关注

spring-boot集成定时任务

黄昏孤酒

关注

阅读 35

2023-02-04


@Component
@EnableScheduling
public class MQProducer {

@Autowired
private JmsMessagingTemplate jmsMessagingTemplate;
@Autowired
private QueneConfig qc;

@Scheduled(fixedDelay=3000)//每3s执行1次
public void send() {
this.jmsMessagingTemplate.convertAndSend(qc.mq, "hi,activeMQ");
}

}


相关推荐

浮游图灵

spring-boot动态添加、删除定时任务

浮游图灵 109 0 0

MaxWen

Spring Boot 定时任务

MaxWen 98 0 0

夕颜合欢落

spring Boot定时任务

夕颜合欢落 60 0 0

前行的跋涉者

Spring Boot定时任务

前行的跋涉者 93 0 0

幸福的无所谓

spring boot定时任务

幸福的无所谓 50 0 0

中间件小哥

Spring Boot(九):定时任务

中间件小哥 87 0 0

非凡兔

spring boot定时任务方式

非凡兔 56 0 0

前行的跋涉者

Spring Boot实现定时任务

前行的跋涉者 20 0 0

Aliven888

Spring Boot 检索&定时任务

Aliven888 177 0 0

小时候是个乖乖

Spring Boot 定时任务 -- @Scheduled

小时候是个乖乖 147 0 0

精彩评论(0)

0 0 举报