Persistent Messages Sent to Queues
Persistent messages sent to a queue are always written to disk. Should the server fail before sending persistent messages to consumers, the server can be restarted and the persistent messages will be sent to the consumers when they reconnect to the server.
Persistent Messages Sent to Topics
Persistent messages published to a topic are written to disk ONLY IF that topic has at least one durable subscriber or one subscriber with a fault-tolerant connectionto the EMS server.
Non-durable subscribers that re-connectafter a server failure are considered newly created subscribers and are not entitled to receive any messages created prior to the time they are created.
When using file storage, persistent messages received by the EMS server are by default written asynchronously to disk.
When a producer sends a persistent message, the server does not wait for the write-to-disk operation to complete before returning control to the producer.
This means that the producer has no way of detecting the failure of persisting the message and take corrective action if the server fails before completing the write-to-disk operation.
What do you do if you want to SYNCHRONOUSLY write to disk?
You can set the mode parameter to sync for a given file storage in the stores.conffile to specify that persistent messages for the topic or queue be synchronously written to disk.
When mode = sync, the persistent producer remains blocked until the server has completed the write-to-disk operation.
No comments:
Post a Comment