INT-4081: Post-merge polishing and improvements

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

* Rename `MessageGroupPreparedStatementSetter` to `ChannelMessageStorePreparedStatementSetter`
* Add JavaDocs to the `ChannelMessageStorePreparedStatementSetter`
* Polishing `JdbcChannelMessageStore` JavaDocs; remove unused `BeanFactory`
* Polishing Docs for typos and proper text flow
This commit is contained in:
Artem Bilan
2017-10-23 11:41:04 -04:00
parent 34d0859515
commit d7d56a0444
6 changed files with 211 additions and 207 deletions

View File

@@ -365,35 +365,29 @@ If your database is not listed, you can easily extend the `AbstractChannelMessag
Since _version 4.0_, the `MESSAGE_SEQUENCE` column has been added to the table to ensure first-in-first-out (FIFO) queueing even when messages are stored in the same millisecond.
Since_version 5.0, by overloading `MessageGroupPreparedStatementSetter` class you can provide custom
implementation to `PreparedStatementSetter` to support different columns or table structure
or serialization strategy.
For example, instead of default serialization to byte[], we can store its structure in JSON string.
Since _version 5.0_, by overloading `ChannelMessageStorePreparedStatementSetter` class you can provide custom implementation for message insertion in the `JdbcChannelMessageStore`.
It might be different columns or table structure or serialization strategy.
For example, instead of default serialization to `byte[]`, we can store its structure in JSON string.
Below example uses the default implementation of `setValues` to store common columns and overrides the behavior
just to store the message payload as varchar.
Below example uses the default implementation of `setValues` to store common columns and overrides the behavior just to store the message payload as varchar.
[source,java]
----
public class JsonPreparedStatementSetter extends ChannelMessageStorePreparedStatementSetter {
public class CustomMessageGroupPreparedStatementSetter
extends MessageGroupPreparedStatementSetter {
public JsonPreparedStatementSetter() {
super();
}
public CustomMessageGroupPreparedStatementSetter() {
super();
}
@Override
public void setValues(PreparedStatement preparedStatement, Message<?> requestMessage,
Object groupId, String region, boolean priorityEnabled) throws SQLException {
// Populate common columns
super.setValues(preparedStatement, requestMessage, groupId, region, priorityEnabled);
// Store message payload as varchar
preparedStatement.setString(6, requestMessage.getPayload().toString());
}
@Override
public void setValues(PreparedStatement preparedStatement, Message<?> requestMessage,
Object groupId, String region, boolean priorityEnabled) throws SQLException {
// Populate common columns
super.setValues(preparedStatement, requestMessage, groupId, region, priorityEnabled);
// Store message payload as varchar
preparedStatement.setString(6, requestMessage.getPayload().toString());
}
}
----
[IMPORTANT]

View File

@@ -294,7 +294,6 @@ See <<gemfire>> for more information.
==== Jdbc Message Channel Store Changes
The `JdbcMessageChannelStore` now provides setter to set `MessageGroupPreparedStatementSetter`,
allowing users to easily customize `PreparedStatementSetter` in the store.
The `JdbcMessageChannelStore` now provides setter for the `ChannelMessageStorePreparedStatementSetter` allowing users to customize a message insertion in the store.
See <<jdbc-message-store-channels>> for more information.