This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Configuring MySQL

To configure and run MySQL as your RDBMS, you must do the following.

  1. Open the <MB_HOME>/repository/conf/datasources/master-datasources.xml file. This is where datasources are configured to point to the databases used by the Message Broker. This file consists of commented out configurations for datasources. The datasource configuration for MySQL is among these. The changes made to this file must be done in both broker nodes.
  2. Uncomment or add the following configuration into the master-datasources.xml file. Update the JDBC URL to correctly point to your database and enter the username and password for a MySQL database user with the proper permissions.

     <datasource>
                 <name>MYSQL_DATA_SOURCE</name>
                 <jndiConfig>
                     <name>jdbc/MySQLMessageStore</name>
                 </jndiConfig>
                 <definition type="RDBMS">
                     <configuration>
                         <driverClassName>com.mysql.jdbc.Driver</driverClassName>
                         <url>jdbc:mysql://localhost/WSO2_MB</url>
                         <username>root</username>
                         <password>root</password>
                     </configuration>
                 </definition>
    </datasource>

     

  3. Open the <MB_HOME>/repository/conf/broker.xml file. This is the root configuration file of Message Broker. The changes made to this file must be done in all the WSO2 Message Broker nodes.
  4. In the broker.xml file we need to use the MySQL message store and Andes context store. To do this, uncomment or add the following configuration.

    ...
    <persistence>
      <messageStore class="org.wso2.andes.store.rdbms.RDBMSMessageStoreImpl">
            <property name="dataSource">jdbc/MySQLMessageStore</property>
      </messageStore>
    
      <andesContextStore    class="org.wso2.andes.store.rdbms.RDBMSAndesContextStoreImpl">
            <property name="dataSource">jdbc/MySQLMessageStore</property>
      </andesContextStore>
    ...
    </persistence>