Marking messages as persistent doesn't fully guarantee that a message won't be lost. Although it tells RabbitMQ to save the message to disk, there is still a short time window when RabbitMQ has accepted a message and hasn't saved it yet. Also, RabbitMQ doesn't do fsync(2) for every message -- it may be just saved to cache and not really written to the disk. The persistence guarantees aren't strong, but it's more than enough for our simple task queue. If you need a stronger guarantee then you can use
prefetch
perfetch用来设置,如果一个消息还没有被消费者处理完并确认,就不要再给这个消息发送消息
ch.prefetch(1);
推送订阅
工作队列,每个消息只能被一个消费者消费。而推送订阅方式,一个消息可以被多个消费者消费。
The core idea in the messaging model in RabbitMQ is that the producer never sends any messages directly to a queue.
Instead, the producer can only send messages to an exchange.
There are a few exchange types available: - direct, topic, headers and fanout
基本概念
工作队列
队列durable和消息persistent的区别?
prefetch
perfetch用来设置,如果一个消息还没有被消费者处理完并确认,就不要再给这个消息发送消息
推送订阅
工作队列,每个消息只能被一个消费者消费。而推送订阅方式,一个消息可以被多个消费者消费。
临时队列
队列
队列属性
队列声明
exchange
其他
参考