RabbitMq笔记

对于生产者的消息推送的参数分析  

void basicPublish(String exchange, String routingKey, BasicProperties props, byte[] body) throws IOException;

void basicPublish(String exchange, String routingKey, boolean mandatory, BasicProperties props, byte[] body) throws IOException;

void basicPublish(String exchange, String routingKey, boolean mandatory, boolean immediate, BasicProperties props, byte[] body) throws IOException;

exchange:交换机

routingKey:路由键

mandatory:告诉服务器,至少将消息路由到一个队列中,否则消息返回给生产者

immediate:告诉服务器,如果该队列关联的队列上有消费者,则立即投递,若所有匹配的队列上都没有消费者,者直接将消息返回给生产者,不用将消息存到队列等待消费

 

posted @ 2020-06-09 11:09  码处世界来  阅读(163)  评论(0编辑  收藏  举报