增加项目README.md

This commit is contained in:
罗祥
2019-01-07 17:15:51 +08:00
parent 8716dd8648
commit 161521f8a5
70 changed files with 3835 additions and 51 deletions

View File

@ -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);
}
});

View File

@ -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 接收到