6.4. Customizing the JDBC Persistence Adapter
Overview
Customizing the SQL statements used by the adapter
statements element to the JDBC persistence adapter configuration. Example 6.5, “Fine Tuning the Database Schema” shows a configuration snippet that specifies that long strings are going to be stored as VARCHAR(128).
Example 6.5. Fine Tuning the Database Schema
<persistenceAdapter>
<jdbcPersistenceAdapter ... >
<statements>
<statements stringIdDataType ="VARCHAR(128)"/>
</statements>
</jdbcPersistenceAdapter>
</persistenceAdapter>statements element is a wrapper for one or more nested statements elements. Each nested statements element specifies a single configuration statement. Table 6.3, “Statements for Configuring the SQL Statements Used by the JDBC Persistence Adapter” describes the configurable properties.
Table 6.3. Statements for Configuring the SQL Statements Used by the JDBC Persistence Adapter
Customizing SQL statements for unsupported databases
addMessageStatementupdateMessageStatementremoveMessageStatementfindMessageSequenceIdStatementfindMessageStatementfindAllMessagesStatementfindLastSequenceIdInMsgsStatementfindLastSequenceIdInAcksStatementcreateDurableSubStatementfindDurableSubStatementfindAllDurableSubsStatementupdateLastAckOfDurableSubStatementdeleteSubscriptionStatementfindAllDurableSubMessagesStatementfindDurableSubMessagesStatementfindAllDestinationsStatementremoveAllMessagesStatementremoveAllSubscriptionsStatementdeleteOldMessagesStatementlockCreateStatementlockUpdateStatementnextDurableSubscriberMessageStatementdurableSubscriberMessageCountStatementlastAckedDurableSubscriberMessageStatementdestinationMessageCountStatementfindNextMessageStatementcreateSchemaStatementsdropSchemaStatements
Using generic JDBC providers
adapter attribute to reference the bean ID of the relevant adapter. The following adapter types are supported:
org.activemq.store.jdbc.adapter.BlobJDBCAdapterorg.activemq.store.jdbc.adapter.BytesJDBCAdapterorg.activemq.store.jdbc.adapter.DefaultJDBCAdapterorg.activemq.store.jdbc.adapter.ImageJDBCAdapter
Example 6.6. Configuring a Generic JDBC Provider
<broker persistent="true" ... >
...
<persistenceAdapter>
<jdbcPersistenceAdapter adapter="#blobAdapter" ... />
</persistenceAdapter>
<bean id="blobAdapter"
class="org.activemq.store.jdbc.adapter.BlobJDBCAdapter"/>
...
</broker>
Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.