INT-4002: JDBC MS Doc: DB init in the beginning

JIRA https://jira.spring.io/browse/INT-4002

To avoid some confuses during developing target applications,
warn end-users that it is important to initialize data base before
running applications with JDBC Message Stores
This commit is contained in:
Artem Bilan
2017-05-24 18:06:17 -04:00
committed by Gary Russell
parent 533fa17f76
commit bb2ee967f2

View File

@@ -292,10 +292,19 @@ See <<jdbc-outbound-channel-adapter>> for more information about `MessagePrepare
=== JDBC Message Store
Spring Integration provides 2 JDBC specific Message Store implementations.
The first one, is the `JdbcMessageStore` which is suitable to be used in conjunction with _Aggregators_ and the
_Claim-Check_ pattern.
The first one, is the `JdbcMessageStore` which is suitable to be used in conjunction with _Aggregators_ and the _Claim-Check_ pattern.
While it can be used for backing _Message Channels_ as well, you may want to consider using the `JdbcChannelMessageStore` implementation instead, as it provides a more targeted and scalable implementation.
==== Initializing the Database
Before starting to use JDBC Message Store components, it is important to provision target data base with the appropriate objects.
Spring Integration ships with some sample scripts that can be used to initialize a database.
In the `spring-integration-jdbc` JAR file you can find scripts in the `org.springframework.integration.jdbc` package: there is a create and a drop script example for a range of common database platforms.
A common way to use these scripts is to reference them in a https://docs.spring.io/spring/docs/current/spring-framework-reference/html/jdbc.html#jdbc-intializing-datasource[Spring JDBC data source initializer].
Note that the scripts are provided as samples or specifications of the the required table and column names.
You may find that you need to enhance them for production use (e.g. with index declarations).
[[jdbc-message-store-generic]]
==== The Generic JDBC Message Store
@@ -440,14 +449,6 @@ To configure that scenario, simply extend one message store bean from the other:
</int:channel>
----
==== Initializing the Database
Spring Integration ships with some sample scripts that can be used to initialize a database.
In the `spring-integration-jdbc` JAR file you can find scripts in the `org.springframework.integration.jdbc` package: there is a create and a drop script example for a range of common database platforms.
A common way to use these scripts is to reference them in a https://docs.spring.io/spring/docs/current/spring-framework-reference/html/jdbc.html#jdbc-intializing-datasource[Spring JDBC data source initializer].
`Note that the scripts are provided as samples or specifications of the the required table and column names.
You may find that you need to enhance them for production use (e.g. with index declarations).
==== Partitioning a Message Store
It is common to use a `JdbcMessageStore` as a global store for a group of applications, or nodes in the same application.