public class SqlConsumer
extends org.apache.camel.impl.ScheduledBatchPollingConsumer
Constructor and Description |
---|
SqlConsumer(SqlEndpoint endpoint,
org.apache.camel.Processor processor,
org.springframework.jdbc.core.JdbcTemplate jdbcTemplate,
String query,
SqlPrepareStatementStrategy sqlPrepareStatementStrategy,
SqlProcessingStrategy sqlProcessingStrategy) |
Modifier and Type | Method and Description |
---|---|
protected org.apache.camel.Exchange |
createExchange(Object data) |
SqlEndpoint |
getEndpoint() |
int |
getExpectedUpdateCount() |
String |
getOnConsume() |
String |
getOnConsumeBatchComplete() |
String |
getOnConsumeFailed() |
boolean |
isBreakBatchOnConsumeFail() |
boolean |
isRouteEmptyResultSet()
Indicates whether empty resultset should be allowed to be sent to the next hop or not
|
boolean |
isUseIterator()
Indicates how resultset should be delivered to the route
|
protected int |
poll() |
int |
processBatch(Queue<Object> exchanges) |
void |
setBreakBatchOnConsumeFail(boolean breakBatchOnConsumeFail)
Sets whether to break batch if onConsume failed.
|
void |
setExpectedUpdateCount(int expectedUpdateCount)
Sets an expected update count to validate when using onConsume.
|
void |
setMaxMessagesPerPoll(int maxMessagesPerPoll) |
void |
setOnConsume(String onConsume)
Sets a SQL to execute when the row has been successfully processed.
|
void |
setOnConsumeBatchComplete(String onConsumeBatchComplete) |
void |
setOnConsumeFailed(String onConsumeFailed)
Sets a SQL to execute when the row failed being processed.
|
void |
setRouteEmptyResultSet(boolean routeEmptyResultSet)
Sets whether empty resultset should be allowed to be sent to the next hop.
|
void |
setUseIterator(boolean useIterator)
Sets how resultset should be delivered to route.
|
deferShutdown, getMaxMessagesPerPoll, getPendingExchangesSize, isBatchAllowed, prepareShutdown, processEmptyMessage
afterPoll, beforePoll, doShutdown, doStart, doStop, doSuspend, getBackoffCounter, getBackoffErrorThreshold, getBackoffIdleThreshold, getBackoffMultiplier, getDelay, getInitialDelay, getPollStrategy, getRunLoggingLevel, getScheduledExecutorService, getScheduler, getSchedulerProperties, getTimeUnit, isGreedy, isPollAllowed, isPolling, isSchedulerStarted, isSendEmptyMessageWhenIdle, isStartScheduler, isUseFixedDelay, onInit, run, setBackoffErrorThreshold, setBackoffIdleThreshold, setBackoffMultiplier, setDelay, setGreedy, setInitialDelay, setPollStrategy, setRunLoggingLevel, setScheduledExecutorService, setScheduler, setSchedulerProperties, setSendEmptyMessageWhenIdle, setStartScheduler, setTimeUnit, setUseFixedDelay, startScheduler
createUoW, doneUoW, getAsyncProcessor, getExceptionHandler, getProcessor, getRoute, handleException, handleException, setExceptionHandler, setRoute, toString
doResume, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, resume, shutdown, start, stop, suspend
public SqlConsumer(SqlEndpoint endpoint, org.apache.camel.Processor processor, org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, String query, SqlPrepareStatementStrategy sqlPrepareStatementStrategy, SqlProcessingStrategy sqlProcessingStrategy)
public SqlEndpoint getEndpoint()
getEndpoint
in interface org.apache.camel.Consumer
getEndpoint
in class org.apache.camel.impl.DefaultConsumer
protected int poll() throws Exception
poll
in class org.apache.camel.impl.ScheduledPollConsumer
Exception
protected org.apache.camel.Exchange createExchange(Object data)
public String getOnConsume()
public void setOnConsume(String onConsume)
public String getOnConsumeFailed()
public void setOnConsumeFailed(String onConsumeFailed)
public String getOnConsumeBatchComplete()
public void setOnConsumeBatchComplete(String onConsumeBatchComplete)
public boolean isUseIterator()
public void setUseIterator(boolean useIterator)
public boolean isRouteEmptyResultSet()
public void setRouteEmptyResultSet(boolean routeEmptyResultSet)
public int getExpectedUpdateCount()
public void setExpectedUpdateCount(int expectedUpdateCount)
expectedUpdateCount
- typically set this value to 1 to expect 1 row updated.public boolean isBreakBatchOnConsumeFail()
public void setBreakBatchOnConsumeFail(boolean breakBatchOnConsumeFail)
public void setMaxMessagesPerPoll(int maxMessagesPerPoll)
setMaxMessagesPerPoll
in interface org.apache.camel.BatchConsumer
setMaxMessagesPerPoll
in class org.apache.camel.impl.ScheduledBatchPollingConsumer
Apache Camel