use of org.apache.camel.component.sql.SqlPrepareStatementStrategy in project camel by apache.
the class ElsqlEndpoint method createConsumer.
@Override
public Consumer createConsumer(final Processor processor) throws Exception {
final SqlProcessingStrategy proStrategy = new ElsqlSqlProcessingStrategy(elSql);
final SqlPrepareStatementStrategy preStategy = new ElsqlSqlPrepareStatementStrategy();
final SqlParameterSource param = new EmptySqlParameterSource();
final String sql = elSql.getSql(elsqlName, new SpringSqlParams(param));
LOG.debug("ElsqlConsumer @{} using sql: {}", elsqlName, sql);
final ElsqlConsumer consumer = new ElsqlConsumer(this, processor, namedJdbcTemplate, sql, param, preStategy, proStrategy);
consumer.setMaxMessagesPerPoll(getMaxMessagesPerPoll());
consumer.setOnConsume(getOnConsume());
consumer.setOnConsumeFailed(getOnConsumeFailed());
consumer.setOnConsumeBatchComplete(getOnConsumeBatchComplete());
consumer.setBreakBatchOnConsumeFail(isBreakBatchOnConsumeFail());
consumer.setExpectedUpdateCount(getExpectedUpdateCount());
consumer.setUseIterator(isUseIterator());
consumer.setRouteEmptyResultSet(isRouteEmptyResultSet());
configureConsumer(consumer);
return consumer;
}
use of org.apache.camel.component.sql.SqlPrepareStatementStrategy in project camel by apache.
the class ElsqlEndpoint method createProducer.
@Override
public Producer createProducer() throws Exception {
final SqlPrepareStatementStrategy prepareStrategy = getPrepareStatementStrategy() != null ? getPrepareStatementStrategy() : new DefaultSqlPrepareStatementStrategy(getSeparator());
final ElsqlProducer result = new ElsqlProducer(this, elSql, elsqlName, namedJdbcTemplate, dataSource, prepareStrategy, isBatch());
return result;
}
Aggregations