Example usage for org.springframework.integration.jdbc.store.channel MessageRowMapper MessageRowMapper

List of usage examples for org.springframework.integration.jdbc.store.channel MessageRowMapper MessageRowMapper

Introduction

In this page you can find the example usage for org.springframework.integration.jdbc.store.channel MessageRowMapper MessageRowMapper.

Prototype

public MessageRowMapper(WhiteListDeserializingConverter deserializer, LobHandler lobHandler) 

Source Link

Usage

From source file:org.springframework.integration.jdbc.store.JdbcChannelMessageStore.java

/**
 * Check mandatory properties ({@link DataSource} and
 * {@link #setChannelMessageStoreQueryProvider(ChannelMessageStoreQueryProvider)}). If no {@link MessageRowMapper} was
 * explicitly set using {@link #setMessageRowMapper(MessageRowMapper)}, the default
 * {@link MessageRowMapper} will be instantiate using the specified {@link #deserializer}
 * and {@link #lobHandler}.//w  w w  . j  a  va 2  s. co  m
 *
 * Also, if the jdbcTemplate's fetchSize property ({@link JdbcTemplate#getFetchSize()})
 * is not 1, a warning will be logged. When using the {@link JdbcChannelMessageStore}
 * with Oracle, the fetchSize value of 1 is needed to ensure FIFO characteristics
 * of polled messages. Please see the Oracle {@link ChannelMessageStoreQueryProvider} for more details.
 *
 * @throws Exception
 */
public void afterPropertiesSet() throws Exception {
    Assert.state(jdbcTemplate != null, "A DataSource or JdbcTemplate must be provided");
    Assert.notNull(this.channelMessageStoreQueryProvider,
            "A channelMessageStoreQueryProvider must be provided.");

    if (this.messageRowMapper == null) {
        this.messageRowMapper = new MessageRowMapper(this.deserializer, this.lobHandler);
    }

    if (this.jdbcTemplate.getFetchSize() != 1 && logger.isWarnEnabled()) {
        logger.warn(
                "The jdbcTemplate's fetchsize is not 1 but %s. This may cause FIFO issues with Oracle databases.");
    }

}