public class ChannelMessageStorePreparedStatementSetter extends Object
JdbcChannelMessageStore.
Behavior is same as standard PreparedStatementSetter,
it takes in additional Message<?> requestMessage, Object groupId,
String region and boolean priorityEnabled parameters used
for addMessageToGroup method
in the JdbcChannelMessageStore.
This class can be extended for any custom data structure or columns types.
For this purpose the protected constructor is provided for inheritors.
In this case the serializer and lobHandler are null to avoid
extra serialization actions if the target custom behavior doesn't imply them.
PreparedStatementSetter| Modifier | Constructor and Description |
|---|---|
protected |
ChannelMessageStorePreparedStatementSetter()
The default constructor for inheritors who are not interested in the message
serialization to
byte[]. |
|
ChannelMessageStorePreparedStatementSetter(SerializingConverter serializer,
LobHandler lobHandler)
Instantiate a
ChannelMessageStorePreparedStatementSetter with the provided
serializer and lobHandler, which both must not be null. |
| Modifier and Type | Method and Description |
|---|---|
void |
setValues(PreparedStatement preparedStatement,
Message<?> requestMessage,
Object groupId,
String region,
boolean priorityEnabled)
Perform a preparedStatement parameters population according provided arguments.
|
public ChannelMessageStorePreparedStatementSetter(SerializingConverter serializer, LobHandler lobHandler)
ChannelMessageStorePreparedStatementSetter with the provided
serializer and lobHandler, which both must not be null.serializer - the SerializingConverter to build byte[] from
the request messagelobHandler - the LobHandler to store byte[] of the request
message to prepared statementprotected ChannelMessageStorePreparedStatementSetter()
byte[].
The serializer and lobHandler are null from this constructor,
therefore any serialization isn't happened in the default setValues(java.sql.PreparedStatement, org.springframework.messaging.Message<?>, java.lang.Object, java.lang.String, boolean) implementation.
A target implementor must ensure the proper custom logic for storing message.public void setValues(PreparedStatement preparedStatement, Message<?> requestMessage, Object groupId, String region, boolean priorityEnabled) throws SQLException
serializer and lobHandler are provided.
preparedStatement - the PreparedStatement to populate columns based on the provided argumentsrequestMessage - the Message to storegroupId - the group id for the message to storeregion - the region in the target table to distinguish different data base clientspriorityEnabled - the flag to indicate if priority has to be storedSQLException - the exception throws during data population