LibraryLink ToToggle FramesPrintFeedback

Using JDBC with the High Performance Journal

Using the JDBC persistence adapter with FUSE Message Broker's high performance journal boosts the performance of the persistence adapter in two ways:

In addition to the performance gains, the high performance journal also makes it possible to ensure the consistency of JMS transactions in the case of a system failure.

To configure FUSE Message Broker to use the JDBC persistence adapter with the high performance journal you add the journaledJDBC element to the persistenceAdapter element in your broker's configuration as shown in Example 3.5.

Table 3.2 describes the attributes used to configure the journaled JDBC persistence adapter.


Example 3.5 shows a configuration snip-it that configures the journaled JDBC adapter to use a MySQL database.

Example 3.5. Configuring FUSE Message Broker to use the Journaled JDBC Persistence Adapter

<beans ...>
  <broker ...>
    ...
1  <persistenceAdapter>
2    <journaledJDBC journalLogFiles="5" dataSource="#mysql-ds" />
    </persistenceAdapter>
    ...
  <broker>
  ...
3<bean id="mysql-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
    <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
    <property name="url" value="jdbc:mysql://localhost/activemq?relaxAutoCommit=true"/>
    <property name="username" value="activemq"/>
    <property name="password" value="activemq"/>
    <property name="poolPreparedStatements" value="true"/>
  </bean>

The configuration in Example 3.5 has three noteworthy elements:

1

The persistenceAdapter element wraps the configuration for the JDBC persistence adapter.

2

The journaledJDBC element specifies that the broker will use the JDBC persistence adapter with the high performance journal. The element's attributes configure the following properties:

  • The journal will span five log files.

  • Quick journaling will be used. Therefore only message references will be written to the JDBC database.

  • The configuration for the JDBC driver is specified in a bean element with the id mysql-ds.

3

The bean element specified the configuration for the MySQL JDBC driver.