Red Hat AMQ 6
As of February 2025, Red Hat is no longer supporting Red Hat AMQ 6. If you are using AMQ 6, please upgrade: Migrating to AMQ 7.Ce contenu n'est pas disponible dans la langue sélectionnée.
6.2. Using the Plain JDBC Adapter
Overview Copier lienLien copié sur presse-papiers!
Copier lienLien copié sur presse-papiers!
This section describes how to use the plain JDBC adapter, which is the recommended adapter to use for most applications.
Example Copier lienLien copié sur presse-papiers!
Copier lienLien copié sur presse-papiers!
Example 6.3, “Configuring Red Hat JBoss A-MQ to use the Plain JDBC Persistence Adapter” shows a configuration fragment that configures the plain JDBC adapter to use the Apache Derby database.
Example 6.3. Configuring Red Hat JBoss A-MQ to use the Plain JDBC Persistence Adapter
The configuration in Example 6.3, “Configuring Red Hat JBoss A-MQ to use the Plain JDBC Persistence Adapter” has three noteworthy elements:
- 1
- The
persistenceAdapter
element wraps the configuration for the JDBC persistence adapter. - 2
- The
jdbcPersistenceAdapter
element specifies that the broker will use the plain JDBC persistence adapter and that the JDBC driver's configuration is specified in abean
element with the ID,derby-ds
. - 3
- The
bean
element specified the configuration for the Derby JDBC driver.
Configuration Copier lienLien copié sur presse-papiers!
Copier lienLien copié sur presse-papiers!
Table 6.1, “Attributes for Configuring the Plain JDBC Persistence Adapter” describes the attributes used to configure the plain JDBC persistence adapter.
Attribute | Default Value | Description |
---|---|---|
adapter | Specifies the strategy to use when accessing a non-supported database. For more information see the section called “Using generic JDBC providers”. | |
cleanupPeriod | 300000 | Specifies, in milliseconds, the interval at which acknowledged messages are deleted. |
createTablesOnStartup | true | Specifies whether or not new database tables are created when the broker starts. If the database tables already exist, the existing tables are reused. |
dataDirectory | activemq-data | Specifies the directory into which the default Derby database writes its files. |
dataSource | #derby | Specifies the id of the Spring bean storing the JDBC driver's configuration. For more information see the section called “Configuring your JDBC driver”. |
transactionIsolation | Connection.TRANSACTION_READ_UNCOMMITTED | Specifies the required transaction isolation level. For allowed values, see java.sql.Connection. |
useLock | true | Specifies in the adapter uses file locking. |
lockKeepAlivePeriod | 30000 | Specifies the time period, in milliseconds, at which the current time is saved in the locker table to ensure that the lock does not timeout. 0 specifies unlimited time. |