LibraryToggle FramesPrintFeedback

Example 4.3 shows a configuration fragment that configures the journaled JDBC adapter to use a MySQL database.

Example 4.3. Configuring Fuse Message Broker to use the Journaled JDBC Persistence Adapter

<beans ... >
  <broker ...>
    ...
1  <persistenceFactory>
2    <journaledJDBC journalLogFiles="5" dataSource="#mysql-ds" />
    </persistenceFactory>
    ...
  <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 4.3 has three noteworthy elements:

1

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

[Note]Note

In Fuse Message Broker versions prior to 5.4, the persistenceAdapter element was sometimes used to wrap the configuration for the JDBC persistence adapter. This is no longer possible in 5.4, because the broker performs strict schema checking on the configuration file.

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.

  • 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.

Comments powered by Disqus