测试延迟消息,创建queue
This commit is contained in:
parent
b5bfe6de1b
commit
26b1ece7ea
@ -0,0 +1,26 @@
|
|||||||
|
package net.jieyuu.biz;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import net.jieyuu.ProductApplication;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
import org.springframework.test.context.junit4.SpringRunner;
|
||||||
|
|
||||||
|
@RunWith(SpringRunner.class)
|
||||||
|
@SpringBootTest(classes = ProductApplication.class)
|
||||||
|
@Slf4j
|
||||||
|
public class DemoApplicationTests {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RabbitTemplate rabbitTemplate;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void send(){
|
||||||
|
rabbitTemplate.convertAndSend("stock.event.exchange","stock.release.delay.routing.key","23342342");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user