## Chapter 1. Introduction to FUSE Message Broker Persistence

Message persistence allows for the recovery of undelivered messages in the event of a system failure. By default, FUSE Message Broker's persistence features are activated. The default set up is fast and scalable. It is easy to customize the set-up to use and JDBC compliant database.

## Overview

Loss of messages is not acceptable in mission critical applications. FUSE Message Broker reduces the risk of message loss by using a persistent message store by default. Persistent messages are written to the persistent store when they are sent. The messages persist in the store until their delivery is confirmed. This means that in the case of a system failure, FUSE Message Broker can recover all of the undelivered messages at the time of the failure.

## Persistent message stores

The default message store is embeddable and transactional. It both very fast and extremely reliable. In addition to the default message store, FUSE Message Broker offers a number of other persistent message store options. These include:

- AMQ Message Store

- a journaled JDBC adapter

- a non-journaled JDBC adapter

## Activating and deactivating persistence

Persistence in FUSE Message Broker is controlled by a broker's XML configuration file. To change a broker's persistence behavior you modify the configuration's `broker` element's `persistent` attribute.

Table 1.1. Setting a Broker's Persistence

Value | Description
--- | ---
`true` | The broker will use message persistence.
`false` | The broker will not use message persistence.
| Important
If you add persistence adapters to a broker's configuration, this setting is ignored.

| Tip
By default, a broker's `persistent` attribute is set to `true`.

Example 1.1 shows a configuration snip-it for turning off a broker's message persistence.

Example 1.1. Turning Off a Broker's Persistence

    <broker persistent="false" ...>
      ...
    </broker>

## Configuring persistence adapter behavior

FUSE Message Broker offers a number of different persistence mechanisms aside from the default message store. To use one of the alternative message stores, or to modify the default behavior of the default message store, you need to configure the persistence adapter. This is done by adding a `persistenceAdapter` element to the broker's configuration file as shown in Example 1.2.

Example 1.2. Adding Persistence Adapter Configuration

    <broker persistent="true" ...>
      ...
      <persistenceAdapter>
        <amqPersistenceAdapter ... />
      </persistenceAdapter>
      ...
    <broker>

The `persistenceAdapter` element has no attributes. The configuration for the persistence adapter is specified using a child element for the desired persistence adapter.