Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
yanhom1314 committed Jul 13, 2023
1 parent 13c00e3 commit 10b0b17
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,10 @@
public class TestController {

@Resource
RabbitTemplate rabbitTemplate; //使用RabbitTemplate,这提供了接收/发送等等方法
RabbitTemplate rabbitTemplate;

@GetMapping("/dtp-example-adapter/testRabbitMq")
public String sendDirectMessage() {

rabbitTemplate.convertAndSend("testQueue", "hello, dynamic-tp");
return "ok";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,10 @@ public class RabbitMqConsumer {

@RabbitListener(containerFactory = "rabbitListenerContainerFactory")
@RabbitHandler
public void process(String text) throws InterruptedException {
public void process(String text) {
Thread thread = Thread.currentThread();
String name = thread.getName();
long id = thread.getId();
//Thread.sleep(2000L);
//TimeUnit.SECONDS.sleep(1);
log.info("thread id :"+id+";thread name :"+name+" Receiver : " + text);
log.info("receive message: {}, thread name: {}, thread id: {}", text, name, id);
}
}

0 comments on commit 10b0b17

Please sign in to comment.