完成springboot-rabbitmq升级重构
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
package com.xncoding.pos;
|
||||
package com.xncoding;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
@ -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 --> 定点消息");
|
||||
}
|
||||
}
|
||||
@ -34,5 +34,5 @@ logging:
|
||||
ROOT: INFO
|
||||
com:
|
||||
xncoding: DEBUG
|
||||
file: E:/logs/app.log
|
||||
file: D:/logs/app.log
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user