@ManagedResource(description="Managed Scheduled TimerConnector Endpoint") public class SchedulerTimerConnectorEndpoint extends DefaultConnectorEndpoint
from("timer:something?period=2000") .to("foo:hello") .log("Foo says ${body}");.. can now be done without the manual timer
from("foo:hello?schedulePeriod=2000") .log("Foo says ${body}");This requires the connector to have configured: "scheduler": "timer" such as shown in the petstore-connector.
Constructor and Description |
---|
SchedulerTimerConnectorEndpoint(String endpointUri,
ConnectorComponent component,
org.apache.camel.Endpoint endpoint,
DataType inputDataType,
DataType outputDataType) |
Modifier and Type | Method and Description |
---|---|
org.apache.camel.Consumer |
createConsumer(org.apache.camel.Processor processor) |
long |
getPeriod() |
void |
setPeriod(long period) |
createProducer, doStart, doStop, getAfterConsumer, getAfterProducer, getBeforeConsumer, getBeforeProducer, getComponent, getDelegateEndpointUri, getEndpoint, getInputDataType, getOutputDataType, isSingleton, setAfterConsumer, setAfterProducer, setBeforeConsumer, setBeforeProducer
configureConsumer, configurePollingConsumer, configureProperties, createEndpointConfiguration, createEndpointUri, createExchange, createExchange, createExchange, createPollingConsumer, equals, getCamelContext, getConsumerProperties, getEndpointConfiguration, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isBridgeErrorHandler, isLenientProperties, isPollingConsumerBlockWhenFull, isSynchronous, setBridgeErrorHandler, setCamelContext, setConsumerProperties, setEndpointConfiguration, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setPollingConsumerBlockTimeout, 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
public SchedulerTimerConnectorEndpoint(String endpointUri, ConnectorComponent component, org.apache.camel.Endpoint endpoint, DataType inputDataType, DataType outputDataType)
public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor) throws Exception
createConsumer
in interface org.apache.camel.Endpoint
createConsumer
in class DefaultConnectorEndpoint
Exception
@ManagedAttribute(description="Delay in milli seconds between scheduling (executing)") public long getPeriod()
public void setPeriod(long period)
Apache Camel