完成springboot-rabbitmq升级重构

This commit is contained in:
Xiong Neng
2018-09-15 14:51:29 +08:00
parent 6aa09ccc11
commit 1c339ec836
6 changed files with 46 additions and 4 deletions

View File

@ -1,4 +1,4 @@
package com.xncoding.pos;
package com.xncoding;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

View File

@ -0,0 +1,30 @@
package com.xncoding.pos;
import com.xncoding.pos.service.SenderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
/**
* AfterStartRunner
*
* @author XiongNeng
* @version 1.0
* @since 2018/9/15
*/
@Component
@Order(1)
public class AfterStartRunner implements CommandLineRunner {
@Autowired
private SenderService senderService;
@Override
public void run(String... args) throws Exception {
System.out.println("--------------start-------------");
Thread.sleep(2000L);
// 测试广播模式
senderService.broadcast("AfterStartRunner --> 同学们集合啦!");
// 测试Direct模式
senderService.direct("AfterStartRunner --> 定点消息");
}
}

View File

@ -34,5 +34,5 @@ logging:
ROOT: INFO
com:
xncoding: DEBUG
file: E:/logs/app.log
file: D:/logs/app.log

View File

@ -1,6 +1,6 @@
package com.xncoding.service;
import com.xncoding.pos.Application;
import com.xncoding.Application;
import com.xncoding.pos.service.SenderService;
import org.junit.Test;
import org.junit.runner.RunWith;