Persistent Messages and Synchronous File Storage
When using file-based stores or FTL stores, persistent messages received by the EMS server are by default written asynchronously to disk. This means that, 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.
Should the server fail before completing the write-to-disk operation, the producer has no way of detecting the failure to persist the message and taking corrective action.
You can set the mode parameter to sync for a given file-based store or FTL store to specify that persistent messages for the topic or queue be synchronously written to disk.
When
mode = sync
, the producer remains blocked until the write-to-disk operation is completed. In the case of FTL stores, the producer will continue to remain blocked until the message has been replicated to the other EMS servers in the cluster and written to disk. This parameter is not relevant in the case of grid stores, where the disk access mode is always synchronous.
When using file-based stores, the EMS server writes persistent messages to a store file. To prevent two servers from using the same store file, each server restricts access to its store file for the duration of the server process. For details on how EMS manages access to shared file-based stores, see Managing Access to Shared File-Based Stores.
When using FTL stores, the EMS server stores persistent messages in FTL. See Persistence with FTL Stores for more information.