public abstract class ScheduledPollEndpoint extends DefaultEndpoint
Endpoint
which creates a ScheduledPollConsumer
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
Modifier | Constructor and Description |
---|---|
protected |
ScheduledPollEndpoint() |
protected |
ScheduledPollEndpoint(String endpointUri)
Deprecated.
|
protected |
ScheduledPollEndpoint(String endpointUri,
CamelContext context)
Deprecated.
|
protected |
ScheduledPollEndpoint(String endpointUri,
Component component) |
Modifier and Type | Method and Description |
---|---|
protected void |
configurePollingConsumer(PollingConsumer consumer) |
void |
configureProperties(Map<String,Object> options)
Configure properties on this endpoint.
|
protected void |
configureScheduledPollConsumerProperties(Map<String,Object> options,
Map<String,Object> consumerProperties) |
protected void |
doStart()
Implementations override this method to support customized start/stop.
|
protected void |
doStop()
Implementations override this method to support customized start/stop.
|
int |
getBackoffErrorThreshold() |
int |
getBackoffIdleThreshold() |
int |
getBackoffMultiplier() |
long |
getDelay() |
long |
getInitialDelay() |
PollingConsumerPollStrategy |
getPollStrategy() |
LoggingLevel |
getRunLoggingLevel() |
ScheduledExecutorService |
getScheduledExecutorService() |
ScheduledPollConsumerScheduler |
getScheduler() |
Map<String,Object> |
getSchedulerProperties() |
TimeUnit |
getTimeUnit() |
protected void |
initConsumerProperties() |
boolean |
isGreedy() |
boolean |
isSendEmptyMessageWhenIdle() |
boolean |
isStartScheduler() |
boolean |
isUseFixedDelay() |
void |
setBackoffErrorThreshold(int backoffErrorThreshold)
The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in.
|
void |
setBackoffIdleThreshold(int backoffIdleThreshold)
The number of subsequent idle polls that should happen before the backoffMultipler should kick-in.
|
void |
setBackoffMultiplier(int backoffMultiplier)
To let the scheduled polling consumer backoff if there has been a number of subsequent idles/errors in a row.
|
void |
setDelay(long delay)
Milliseconds before the next poll.
|
void |
setGreedy(boolean greedy)
If greedy is enabled, then the ScheduledPollConsumer will run immediately again, if the previous run polled 1 or more messages.
|
void |
setInitialDelay(long initialDelay)
Milliseconds before the first poll starts.
|
void |
setPollStrategy(PollingConsumerPollStrategy pollStrategy)
A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation
to control error handling usually occurred during the poll operation before an Exchange have been created
and being routed in Camel.
|
void |
setRunLoggingLevel(LoggingLevel runLoggingLevel)
The consumer logs a start/complete log line when it polls.
|
void |
setScheduledExecutorService(ScheduledExecutorService scheduledExecutorService)
Allows for configuring a custom/shared thread pool to use for the consumer.
|
void |
setScheduler(ScheduledPollConsumerScheduler scheduler)
Allow to plugin a custom org.apache.camel.spi.ScheduledPollConsumerScheduler to use as the scheduler for
firing when the polling consumer runs.
|
void |
setScheduler(String schedulerName)
Allow to plugin a custom org.apache.camel.spi.ScheduledPollConsumerScheduler to use as the scheduler for
firing when the polling consumer runs.
|
void |
setSchedulerProperties(Map<String,Object> schedulerProperties)
To configure additional properties when using a custom scheduler or any of the Quartz2, Spring based scheduler.
|
void |
setSendEmptyMessageWhenIdle(boolean sendEmptyMessageWhenIdle)
If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead.
|
void |
setStartScheduler(boolean startScheduler)
Whether the scheduler should be auto started.
|
void |
setTimeUnit(TimeUnit timeUnit)
Time unit for initialDelay and delay options.
|
void |
setUseFixedDelay(boolean useFixedDelay)
Controls if fixed delay or fixed rate is used.
|
configureConsumer, createEndpointConfiguration, createEndpointUri, createExchange, createExchange, createExchange, createPollingConsumer, equals, getCamelContext, getComponent, getConsumerProperties, getEndpointConfiguration, getEndpointKey, getEndpointUri, getExchangePattern, getId, getPollingConsumerQueueSize, hashCode, isLenientProperties, isPollingConsumerBlockWhenFull, isSynchronous, setCamelContext, setConsumerProperties, setEndpointConfiguration, setEndpointUri, setEndpointUriIfNotSpecified, setExchangePattern, setPollingConsumerBlockWhenFull, setPollingConsumerQueueSize, setProperties, setSynchronous, toString
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
createConsumer, createProducer
isSingleton
protected ScheduledPollEndpoint(String endpointUri, Component component)
@Deprecated protected ScheduledPollEndpoint(String endpointUri, CamelContext context)
@Deprecated protected ScheduledPollEndpoint(String endpointUri)
protected ScheduledPollEndpoint()
public void configureProperties(Map<String,Object> options)
Endpoint
configureProperties
in interface Endpoint
configureProperties
in class DefaultEndpoint
options
- the options (properties)protected void configureScheduledPollConsumerProperties(Map<String,Object> options, Map<String,Object> consumerProperties)
protected void configurePollingConsumer(PollingConsumer consumer) throws Exception
configurePollingConsumer
in class DefaultEndpoint
Exception
protected void initConsumerProperties()
protected void doStart() throws Exception
ServiceSupport
ServiceSupport.doStop()
for more details.doStart
in class DefaultEndpoint
Exception
ServiceSupport.doStop()
protected void doStop() throws Exception
ServiceSupport
ServiceSupport.doStop()
method when
the service is being stopped. This method will also be invoked
if the service is still in uninitialized state (eg has not
been started). The method is always called to allow the service
to do custom logic when the service is being stopped, such as when
CamelContext
is shutting down.doStop
in class DefaultEndpoint
Exception
ServiceSupport.doStart()
public boolean isStartScheduler()
public void setStartScheduler(boolean startScheduler)
public long getInitialDelay()
public void setInitialDelay(long initialDelay)
public long getDelay()
public void setDelay(long delay)
public TimeUnit getTimeUnit()
public void setTimeUnit(TimeUnit timeUnit)
public boolean isUseFixedDelay()
public void setUseFixedDelay(boolean useFixedDelay)
public PollingConsumerPollStrategy getPollStrategy()
public void setPollStrategy(PollingConsumerPollStrategy pollStrategy)
public LoggingLevel getRunLoggingLevel()
public void setRunLoggingLevel(LoggingLevel runLoggingLevel)
public boolean isSendEmptyMessageWhenIdle()
public void setSendEmptyMessageWhenIdle(boolean sendEmptyMessageWhenIdle)
public boolean isGreedy()
public void setGreedy(boolean greedy)
public ScheduledPollConsumerScheduler getScheduler()
public void setScheduler(ScheduledPollConsumerScheduler scheduler)
public void setScheduler(String schedulerName)
public Map<String,Object> getSchedulerProperties()
public void setSchedulerProperties(Map<String,Object> schedulerProperties)
public ScheduledExecutorService getScheduledExecutorService()
public void setScheduledExecutorService(ScheduledExecutorService scheduledExecutorService)
public int getBackoffMultiplier()
public void setBackoffMultiplier(int backoffMultiplier)
public int getBackoffIdleThreshold()
public void setBackoffIdleThreshold(int backoffIdleThreshold)
public int getBackoffErrorThreshold()
public void setBackoffErrorThreshold(int backoffErrorThreshold)
Apache Camel