> Store Messages in Multiple Stores
> As described in Message Delivery Modes, the EMS server writes PERSISTENT messages to disk while waiting for confirmation of receipt from the subscriber. Messages are persisted to a store. The EMS server can write messages to two types of stores: file-based stores and database stores.
> By default, the EMS server writes persistent messages to file-based stores. There are three default store files, as described in Default Store Files. You can configure the system to change the default store files and locations, and also to store non-persistent messages to one or more store files, filtering them by destination. Stores are defined in the stores.conf configuration file, and associated with a destination using the store destination property.
> Stores have properties that allow you to control how the server manages the store files. For example, you can:

> ● | Preallocate disk space for the store file.

> ● | Truncate the file periodically to relinquish disk space.

> ● | Specify whether messages in a file-based store are written synchronously or asynchronously.

> ● | Store messages in a database. This feature is described in Chapter 10, Using Database Stores.

> With the multiple stores feature, you can configure your messaging application to store messages in different locations for each application, or to create separate backup files for related destinations. For example, you can create one store for messages supporting Marketing, and one for messages supporting Sales. Because stores are configured in the server, they are transparent to clients.
> The EMS Administration Tool allows administrators to review the system’s configured stores and their settings by using the show stores and show store commands.
> Store Messages in a File
> The EMS server stores persistent messages in file-based stores. You can also create custom file-based stores, and direct the EMS server to write messages to these store files by associating a destination with a store.
> File-based stores are enabled by default, and the server automatically defines three default stores, described below. You do not need to do anything in order to use the default stores. The section Configuring Multiple Stores below describes how to change store settings or create custom stores.
> Default Store Files
> The EMS server defines these default store files, and writes persistent messages and meta data to them:

> ● | $sys.nonfailsafe—Persistent messages without a store property designation are written to $sys.nonfailsafe by default. The server writes messages to this store using asynchronous I/O calls.

> ● | $sys.failsafe—Associate a destination with this store to write messages synchronously. The server writes messages to this store using synchronous I/O calls.

> ● | $sys.meta—This server writes state information about durable subscribers, fault-tolerant connections, and other metadata in this store.

> The EMS server creates these file-based stores automatically, and no steps are required to enable or deploy them. However, you can change the system configuration to customize the default store file settings, or even override the default store settings to either point to different file location or to a database.
> Configuring Multiple Stores
> This section describes the basic steps required to configure multiple file-based stores. Database stores are described in Chapter 10, Using Database Stores.
> Settings for creating and configuring multiple stores are managed in the EMS server, and are transparent to clients. To configure the multiple stores feature, follow these steps:

> 1. | Setup and configure stores in the stores.conf file.

> Stores are created and configured in the stores.conf file. Each store must have a unique name. The stores are configured though parameters.
> File-based stores have two required parameters, type and file, which determine that the store is a file-based store, and set its location and filename. Optional parameters allow you to determine other settings, including how messages are written to the file, the minimum size of the file, and whether the EMS server attempts to truncate the file.

> 2. | Associate destinations with the configured stores.

> Messages are sent to different stores according to their destinations. Destinations are associated with specific stores with the store parameter in the topics.conf and queues.conf files. You can also change store associations using the setprop topic or setprop queue command in the EMS Administration Tool.
> Multiple destinations can be mapped to the same store, either explicitly or using wildcards. Even if no stores are configured, the server sends persistent messages that are not associated with a store to default stores. See Default Store Files for more information.
> For details about the store parameter, see store on page 64.

Copyright © TIBCO Software Inc. All Rights Reserved.