增加项目README.md
This commit is contained in:
@ -75,7 +75,10 @@ public class RabbitBaseAnnotation {
|
||||
//得到消息体内容
|
||||
byte[] body = message.getBody();
|
||||
System.out.println(firstQueue().getName() + "收到消息:" + new String(body));
|
||||
//第二个参数 代表是否一次签收多条
|
||||
/*
|
||||
* DeliveryTag 是一个单调递增的整数
|
||||
* 第二个参数 代表是否一次签收多条,如果设置为true,则所有DeliveryTag小于该DeliveryTag的消息都会被签收
|
||||
*/
|
||||
channel.basicAck(properties.getDeliveryTag(), false);
|
||||
}
|
||||
});
|
||||
|
@ -41,7 +41,7 @@ public class RabbitTest {
|
||||
Message message4 = new Message(notReceived.getBytes(), properties);
|
||||
rabbitTemplate.send("topic01", "quick.brown.fox", message4);
|
||||
|
||||
/*
|
||||
/* 结果:
|
||||
* SecondQueue收到消息:我的路由键 quick.orange.rabbit 符合queue1 和 queue2 的要求,我应该被两个监听器接收到
|
||||
* FirstQueue收到消息:我的路由键 quick.orange.rabbit 符合queue1 和 queue2 的要求,我应该被两个监听器接收到
|
||||
* FirstQueue收到消息:我的路由键 quick.orange.fox 只符合queue1 的要求,只能被queue 1 接收到
|
||||
|
Reference in New Issue
Block a user