Rhapsody uses a custom data store, the Message Store, to store message content (the message body) and metadata (for example, properties).
Metadata is stored in .meta
files and the message body is stored in.body
files. The.meta
and.body
files comprise distinct rolling file blob stores, the Meta Store and the Primary Body Store, which are composed of fixed-size records optimized for fast insertion and reduced I/O operations. The files themselves can accommodate a fixed maximum number of records. When this number of records is reached in a file, new records automatically roll-over to a new file. The metadata and body are referenced by records within queue files as a message is routed through Rhapsody. The message metadata and body are not rewritten unless their respective content changes. If this is the case, a new record is written to the data store as opposed to editing the old record.
Rhapsody uses an archiving strategy of keeping messages for a configurable period of time after they are no longer live. Ordinarily, once this time limit has been exceeded, the message metadata and body are deleted. Because all message bodies and metadata are written to the same rolling .body
and .meta
files, respectively, irrespective of where the messages originated, the Message Store can become very large very quickly.
Therefore, in order to improve memory usage, Rhapsody can be configured to use the Secondary Body Store to store message bodies (especially large ones) which do not need to be kept for long periods of time. Message metadata can reference message bodies in either the Primary Body Store or the Secondary Body Store without any impact on callers. The archive cleanup process deletes files from the Secondary Body Store when they are no longer referenced by any live messages. Consequently, large messages that are only needed for active processing can be deleted immediately rather than potentially remaining in the Message Store for several weeks after being sent. Metadata including the properties and paths, on the other hand, remain in the Message Store for the full archive period, and can still be viewed for a message even if the associated message body is no longer available.
The Secondary Body Store is only available to the (S)FTP Client communication point.
Configuring the Message Store
You can configure general properties of the Message Store using the following properties in the rhapsody.properties
file:
Property | Description | Default Value |
---|---|---|
MessageService.directory |
The location of the Message Store. | messagestore |
MessageService.forceWrites |
Forces the blob store file to write to disk. This is useful for ensuring that message metadata or body is not lost in the event of a system crash. Note, however, that the operating system may ignore this call. | true |
You can configure the location, record size, and number of records per file for the individual stores within the Message Store:
Paths specifying directory locations should be specified using forward slashes. If backslashes must be used, then they must be escaped. For example, the following path formats are acceptable: C:/temp/statistics
or C:\\temp\\statistics
.
Meta Store
You can configure the location, record size, and number of records per file using the rhapsody.properties
file for the Meta Store in the Message Store:
Property | Description | Default Value |
---|---|---|
|
The location of the store. |
|
|
The record size in bytes. |
|
|
The number of records per file. |
|
Primary Body Store
You can configure the location, record size, and number of records per file using the rhapsody.properties
file for the Primary Body Store in the Message Store:
Property | Description | Default Value |
---|---|---|
|
The location of the store. |
|
|
The record size in bytes. |
|
|
The number of records per file. | 16384 (2^14) |
Secondary Body Store
You can configure the location, record size, and number of records per file using the rhapsody.properties
file for the Secondary Body Store in the Message Store:
Property | Description | Default Value |
---|---|---|
|
The location of the store. |
|
|
The record size in bytes. |
|
|
The number of records per file. |
|