Class QuartzEndpoint
java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.support.DefaultEndpoint
org.apache.camel.component.quartz.QuartzEndpoint
- All Implemented Interfaces:
AutoCloseable
,org.apache.camel.CamelContextAware
,org.apache.camel.ComponentAware
,org.apache.camel.Endpoint
,org.apache.camel.IsSingleton
,org.apache.camel.Service
,org.apache.camel.ShutdownableService
,org.apache.camel.spi.HasCamelContext
,org.apache.camel.spi.HasId
,org.apache.camel.StatefulService
,org.apache.camel.SuspendableService
@UriEndpoint(firstVersion="2.12.0",
scheme="quartz",
title="Quartz",
syntax="quartz:groupName/triggerName",
remote=false,
consumerOnly=true,
category=SCHEDULING)
public class QuartzEndpoint
extends org.apache.camel.support.DefaultEndpoint
Schedule sending of messages using the Quartz 2.x scheduler.
-
Field Summary
Fields inherited from class org.apache.camel.support.service.BaseService
BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.camel.Consumer
createConsumer
(org.apache.camel.Processor processor) org.apache.camel.Producer
protected void
doStart()
protected void
doStop()
getCron()
org.quartz.Calendar
org.quartz.TriggerKey
long
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
isRemote()
boolean
boolean
void
onConsumerStart
(QuartzConsumer quartzConsumer) void
onConsumerStop
(QuartzConsumer quartzConsumer) void
void
void
setAutoStartScheduler
(boolean autoStartScheduler) Whether or not the scheduler should be auto started.void
Specifies a cron expression to define when to trigger.void
setCustomCalendar
(org.quartz.Calendar customCalendar) Specifies a custom calendar to avoid specific range of datevoid
setDeleteJob
(boolean deleteJob) If set to true, then the trigger automatically delete when route stop.void
setDurableJob
(boolean durableJob) Whether or not the job should remain stored after it is orphaned (no triggers point to it).void
setIgnoreExpiredNextFireTime
(boolean ignoreExpiredNextFireTime) Whether to ignore quartz cannot schedule a trigger because the trigger will never fire in the future.void
setJobParameters
(Map<String, Object> jobParameters) To configure additional options on the job.void
setPauseJob
(boolean pauseJob) If set to true, then the trigger automatically pauses when route stop.void
setPrefixJobNameWithEndpointId
(boolean prefixJobNameWithEndpointId) Whether the job name should be prefixed with endpoint idvoid
setRecoverableJob
(boolean recoverableJob) Instructs the scheduler whether or not the job should be re-executed if a 'recovery' or 'fail-over' situation is encountered.void
setStateful
(boolean stateful) Uses a Quartz @PersistJobDataAfterExecution and @DisallowConcurrentExecution instead of the default job.void
setTriggerKey
(org.quartz.TriggerKey triggerKey) void
setTriggerName
(String triggerName) void
setTriggerParameters
(Map<String, Object> triggerParameters) To configure additional options on the trigger.void
setTriggerStartDelay
(long triggerStartDelay) In case of scheduler has already started, we want the trigger start slightly after current time to ensure endpoint is fully started before the job kicks in.void
setUsingFixedCamelContextName
(boolean usingFixedCamelContextName) If it is true, JobDataMap uses the CamelContext name directly to reference the CamelContext, if it is false, JobDataMap uses use the CamelContext management name which could be changed during the deploy time.Methods inherited from class org.apache.camel.support.DefaultEndpoint
configureConsumer, configureExchange, configurePollingConsumer, configureProperties, createAsyncProducer, createEndpointUri, createExchange, createExchange, createPollingConsumer, doInit, equals, getCamelContext, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, isLenientProperties, isPollingConsumerBlockWhenFull, isPollingConsumerCopy, isSingleton, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setComponent, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerCopy, setPollingConsumerQueueSize, setProperties, toString
Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getInternalLock, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.camel.ComponentAware
getComponent
Methods inherited from interface org.apache.camel.Endpoint
getEndpointBaseUri, isSingletonProducer
Methods inherited from interface org.apache.camel.Service
build, close, init, start, stop
Methods inherited from interface org.apache.camel.ShutdownableService
shutdown
Methods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending
Methods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Constructor Details
-
QuartzEndpoint
-
-
Method Details
-
isRemote
public boolean isRemote() -
getGroupName
-
getTriggerName
-
setTriggerName
-
getCron
-
isStateful
public boolean isStateful() -
isIgnoreExpiredNextFireTime
public boolean isIgnoreExpiredNextFireTime() -
setIgnoreExpiredNextFireTime
public void setIgnoreExpiredNextFireTime(boolean ignoreExpiredNextFireTime) Whether to ignore quartz cannot schedule a trigger because the trigger will never fire in the future. This can happen when using a cron trigger that are configured to only run in the past. By default, Quartz will fail to schedule the trigger and therefore fail to start the Camel route. You can set this to true which then logs a WARN and then ignore the problem, meaning that the route will never fire in the future. -
getTriggerStartDelay
public long getTriggerStartDelay() -
isDeleteJob
public boolean isDeleteJob() -
isPauseJob
public boolean isPauseJob() -
setPauseJob
public void setPauseJob(boolean pauseJob) If set to true, then the trigger automatically pauses when route stop. Else if set to false, it will remain in scheduler. When set to false, it will also mean user may reuse pre-configured trigger with camel Uri. Just ensure the names match. Notice you cannot have both deleteJob and pauseJob set to true. -
setTriggerStartDelay
public void setTriggerStartDelay(long triggerStartDelay) In case of scheduler has already started, we want the trigger start slightly after current time to ensure endpoint is fully started before the job kicks in. Negative value shifts trigger start time in the past. -
setDeleteJob
public void setDeleteJob(boolean deleteJob) If set to true, then the trigger automatically delete when route stop. Else if set to false, it will remain in scheduler. When set to false, it will also mean user may reuse pre-configured trigger with camel Uri. Just ensure the names match. Notice you cannot have both deleteJob and pauseJob set to true. -
setStateful
public void setStateful(boolean stateful) Uses a Quartz @PersistJobDataAfterExecution and @DisallowConcurrentExecution instead of the default job. -
isDurableJob
public boolean isDurableJob() -
setDurableJob
public void setDurableJob(boolean durableJob) Whether or not the job should remain stored after it is orphaned (no triggers point to it). -
isRecoverableJob
public boolean isRecoverableJob() -
setRecoverableJob
public void setRecoverableJob(boolean recoverableJob) Instructs the scheduler whether or not the job should be re-executed if a 'recovery' or 'fail-over' situation is encountered. -
isUsingFixedCamelContextName
public boolean isUsingFixedCamelContextName() -
setUsingFixedCamelContextName
public void setUsingFixedCamelContextName(boolean usingFixedCamelContextName) If it is true, JobDataMap uses the CamelContext name directly to reference the CamelContext, if it is false, JobDataMap uses use the CamelContext management name which could be changed during the deploy time. -
getTriggerParameters
-
setTriggerParameters
To configure additional options on the trigger. The parameter timeZone is supported if the cron option is present. Otherwise the parameters repeatInterval and repeatCount are supported.Note: When using repeatInterval values of 1000 or less, the first few events after starting the camel context may be fired more rapidly than expected.
-
getJobParameters
-
setJobParameters
To configure additional options on the job. -
isAutoStartScheduler
public boolean isAutoStartScheduler() -
setAutoStartScheduler
public void setAutoStartScheduler(boolean autoStartScheduler) Whether or not the scheduler should be auto started. -
isPrefixJobNameWithEndpointId
public boolean isPrefixJobNameWithEndpointId() -
setPrefixJobNameWithEndpointId
public void setPrefixJobNameWithEndpointId(boolean prefixJobNameWithEndpointId) Whether the job name should be prefixed with endpoint id- Parameters:
prefixJobNameWithEndpointId
-
-
setCron
Specifies a cron expression to define when to trigger. -
getTriggerKey
public org.quartz.TriggerKey getTriggerKey() -
setTriggerKey
public void setTriggerKey(org.quartz.TriggerKey triggerKey) -
getCustomCalendar
public org.quartz.Calendar getCustomCalendar() -
setCustomCalendar
public void setCustomCalendar(org.quartz.Calendar customCalendar) Specifies a custom calendar to avoid specific range of date -
createProducer
- Throws:
Exception
-
createConsumer
public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor) throws Exception - Throws:
Exception
-
doStart
- Overrides:
doStart
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-
doStop
- Overrides:
doStop
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-
getComponent
- Specified by:
getComponent
in interfaceorg.apache.camel.ComponentAware
- Overrides:
getComponent
in classorg.apache.camel.support.DefaultEndpoint
-
pauseTrigger
- Throws:
Exception
-
resumeTrigger
- Throws:
Exception
-
onConsumerStart
- Throws:
Exception
-
onConsumerStop
- Throws:
Exception
-