115 where to find resources to sell (custom)

[Ten Wei: PPS33A integrity management] [] [] [wide variety of continually updated] [randomly selected] [Quality guaranteed]

 

 

 

 

How to ensure that messages are correctly transmitted to RabbitMQ? How to ensure that the message recipient consume the news?

 

1) confirmation transmission mode: to confirm the channel setting mode (transmission confirmation mode), all messages are posted channel is assigned a unique ID. Once the message is delivered to the destination queue, or after the message is written to disk (persistent message may be), the channel sends an acknowledgment to the producer (containing the unique message ID).

If an internal error occurred causing RabbitMQ message is lost, it sends a nack (notacknowledged, unacknowledged) messages. Transmission confirmation pattern is asynchronous, while waiting for the application producer acknowledgment, can continue to send the message.

When the confirmation message arrives producer application, the application callback method producers will be triggered to process the confirmation message.

2) the recipient receives the confirmation message acknowledgments mechanism: the consumer receives each message must be acknowledged (message reception and acknowledgment message are two different operating).

Consumers only confirmed the news, RabbitMQ can safely delete the message from the queue. Here and did not use a timeout mechanism, RabbitMQ only to confirm that the need to re-send the message by connecting the Consumer interrupt. In other words, as long as the connection is not interrupted, RabbitMQ to the Consumer sufficient length of time to process the message. Ensure that the final data consistency;

The following lists some special circumstances: if the consumer receives a message, disconnected or unsubscribe, RabbitMQ think that message was not distributed, then re-distributed to consumers under a subscription before confirming. (There may be a message repeated consumption of risks, need to re) if the consumer has not received the message confirmation message, the connection has not disconnected, the RabbitMQ think the consumer is busy, will not distribute more information to the consumer .

Guess you like

Origin www.cnblogs.com/jenixbsk/p/12161043.html