|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.camel.impl.ServiceSupport
org.apache.camel.impl.DefaultConsumer
org.apache.camel.impl.ScheduledPollConsumer
org.apache.camel.component.ibatis.IBatisPollingConsumer
public class IBatisPollingConsumer
Ibatis Camel Component used to read data from a database. Example Configuration : <route> <from uri="ibatis:selectRecords" /> <to uri="jms:destinationQueue" /> </route> This also can be configured to treat a table as a logical queue by defining an "onConsume" statement. Example Configuration : <route> <from uri="ibatis:selectRecords?consumer.onConsume=updateRecord" /> <to uri="jms:destinationQueue" /> </route> By default, if the select statement contains multiple rows, it will iterate over the set and deliver each row to the route. If this is not the desired behavior then set "useIterator=false". This will deliver the entire set to the route as a list.URI Options
| Name | Default Value | description |
|---|---|---|
| initialDelay | 1000 ms | time before polling starts |
| delay | 500 ms | time before the next poll |
| timeUnit | MILLISECONDS | Time unit to use for delay properties (NANOSECONDS, MICROSECONDS, MILLISECONDS, SECONDS) |
| useIterator | true | If true, processes one exchange per row. If false processes one exchange for all rows |
| onConsume | null | statement to run after data has been processed |
IBatisProcessingStrategy| Field Summary | |
|---|---|
protected int |
pendingExchanges
|
protected ShutdownRunningTask |
shutdownRunningTask
|
| Fields inherited from class org.apache.camel.impl.DefaultConsumer |
|---|
log |
| Constructor Summary | |
|---|---|
IBatisPollingConsumer(IBatisEndpoint endpoint,
Processor processor)
|
|
| Method Summary | |
|---|---|
boolean |
deferShutdown(ShutdownRunningTask shutdownRunningTask)
|
IBatisEndpoint |
getEndpoint()
|
String |
getOnConsume()
Gets the statement(s) to run after successful processing. |
int |
getPendingExchangesSize()
|
boolean |
isBatchAllowed()
|
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 void |
poll()
Polls the database |
void |
processBatch(Queue<Object> exchanges)
|
void |
setMaxMessagesPerPoll(int maxMessagesPerPoll)
|
void |
setOnConsume(String onConsume)
Sets the statement to run after successful processing. |
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. |
| Methods inherited from class org.apache.camel.impl.ScheduledPollConsumer |
|---|
doStart, doStop, getDelay, getInitialDelay, getPollStrategy, getTimeUnit, isPollAllowed, isSuspended, isUseFixedDelay, resume, run, setDelay, setInitialDelay, setPollStrategy, setTimeUnit, setUseFixedDelay, suspend |
| Methods inherited from class org.apache.camel.impl.DefaultConsumer |
|---|
getExceptionHandler, getProcessor, handleException, setExceptionHandler, toString |
| Methods inherited from class org.apache.camel.impl.ServiceSupport |
|---|
addChildService, doShutdown, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, removeChildService, shutdown, start, stop |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.apache.camel.Service |
|---|
start, stop |
| Field Detail |
|---|
protected volatile ShutdownRunningTask shutdownRunningTask
protected volatile int pendingExchanges
| Constructor Detail |
|---|
public IBatisPollingConsumer(IBatisEndpoint endpoint,
Processor processor)
throws Exception
Exception| Method Detail |
|---|
public IBatisEndpoint getEndpoint()
getEndpoint in interface ConsumergetEndpoint in class DefaultConsumer
protected void poll()
throws Exception
poll in class ScheduledPollConsumerExceptionpublic void setMaxMessagesPerPoll(int maxMessagesPerPoll)
setMaxMessagesPerPoll in interface BatchConsumer
public void processBatch(Queue<Object> exchanges)
throws Exception
processBatch in interface BatchConsumerExceptionpublic boolean deferShutdown(ShutdownRunningTask shutdownRunningTask)
deferShutdown in interface ShutdownAwarepublic int getPendingExchangesSize()
getPendingExchangesSize in interface ShutdownAwarepublic boolean isBatchAllowed()
isBatchAllowed in interface BatchConsumerpublic String getOnConsume()
public void setOnConsume(String onConsume)
public boolean isUseIterator()
public void setUseIterator(boolean useIterator)
public boolean isRouteEmptyResultSet()
public void setRouteEmptyResultSet(boolean routeEmptyResultSet)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||