13.4. Configure a Message Store
Procedure 13.1. Task
- Open the global configuration file in a text editor:
vi SOA_ROOT/jboss-as/server/PROFILE/deployers/esb.deployers/jbossesb-properties.xml
. - Scroll down to the section and edit it to suit your configuration:
<properties name="dbstore"> <!-- connection manager type --> <property name="org.jboss.soa.esb.persistence.db.conn.manager" value= "org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/> <!-- this property is only used for the j2ee connection manager --> <property name="org.jboss.soa.esb.persistence.db.datasource.name" value="java:/JBossesbDS"/> <!-- standalone connection pooling settings --> <!-- mysql <property name="org.jboss.soa.esb.persistence.db.connection.url" value="jdbc:mysql://localhost/jbossesb"/> <property name="org.jboss.soa.esb.persistence.db.jdbc.driver" value="com.mysql.jdbc.Driver"/> <property name="org.jboss.soa.esb.persistence.db.user" value="kstam"/> --> <!-- postgres <property name="org.jboss.soa.esb.persistence.db.connection.url" value="jdbc:postgresql://localhost/jbossesb"/> <property name="org.jboss.soa.esb.persistence.db.jdbc.driver" value="org.postgresql.Driver"/> <property name="org.jboss.soa.esb.persistence.db.user" value="postgres"/> <property name="org.jboss.soa.esb.persistence.db.pwd" value="postgres"/> --> <!-- hsqldb --> <property name="org.jboss.soa.esb.persistence.db.connection.url" value="jdbc:hsqldb:hsql://localhost:9001/jbossesb"/> <property name="org.jboss.soa.esb.persistence.db.jdbc.driver" value="org.hsqldb.jdbcDriver"/> <property name="org.jboss.soa.esb.persistence.db.user" value="sa"/> <property name="org.jboss.soa.esb.persistence.db.pwd" value=""/> <property name="org.jboss.soa.esb.persistence.db.pool.initial.size" value="2"/> <property name="org.jboss.soa.esb.persistence.db.pool.min.size" value="2"/> <property name="org.jboss.soa.esb.persistence.db.pool.max.size" value="5"/> <!--table managed by pool to test for valid connections created by pool automatically --> <property name="org.jboss.soa.esb.persistence.db.pool.test.table" value="pooltest"/> <property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis" value="5000"/> </properties>
Note
You will find the scripts for the "required database" schema in theSOA_ROOT/jboss-as/server/PROFILE/deploy/jbossesb.esb/message-store-sql/DB_TYPE/create_database.sql
file. - Sill in the global configuration file, configure the database connection manager:
<!-- connection manager type --> <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.format.db.Standalone ConnectionManager"/> <!-- property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.soa.esb.persistence.manager.J2eeConnectionManager"/ --> <!-- this property is only used for the j2ee connection manager --> <property name="org.jboss.soa.esb.persistence.db.datasource.name" value="java:/JBossesbDS"/>
Note
The Stand-Alone Manager uses C3PO to manage the connection pooling logic whilst the J2eeConnectionManager, by contrast, employs a data-source. Use the latter when deploying Enterprise Service Bus end-points inside a container such as a JBoss Application Server. - Save the file and exit.
- Alternatively, you could plug in a custom connection manager by implementing the
org.jboss.internal.soa.esb.persistence.manager.ConnectionManager
interface and then updating theProperties
file by providing it with the name of the new class.