Class BeanstalkConsumer
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.support.DefaultConsumer
-
- org.apache.camel.support.ScheduledPollConsumer
-
- org.apache.camel.component.beanstalk.BeanstalkConsumer
-
- All Implemented Interfaces:
AutoCloseable
,Runnable
,org.apache.camel.Consumer
,org.apache.camel.EndpointAware
,org.apache.camel.PollingConsumerPollingStrategy
,org.apache.camel.RouteAware
,org.apache.camel.Service
,org.apache.camel.ShutdownableService
,org.apache.camel.spi.RouteIdAware
,org.apache.camel.StatefulService
,org.apache.camel.Suspendable
,org.apache.camel.SuspendableService
public class BeanstalkConsumer extends org.apache.camel.support.ScheduledPollConsumer
PollingConsumer to read Beanstalk jobs. The consumer may delete the job immediately or based on successfulExchange
completion. The behavior is configurable byconsumer.awaitJob
flag (by defaulttrue
) This consumer will add aSynchronization
object to everyExchange
object it creates in order to react on successful exchange completion or failure. In the case of successful completion, Beanstalk'sdelete
method is called upon the job. In the case of failure the default reaction is to callbury
. The reaction on failures is configurable: possible variants are "bury", "release" or "delete"
-
-
Constructor Summary
Constructors Constructor Description BeanstalkConsumer(BeanstalkEndpoint endpoint, org.apache.camel.Processor processor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doStart()
protected void
doStop()
BeanstalkEndpoint
getEndpoint()
BeanstalkCommand
getOnFailure()
boolean
isAwaitJob()
boolean
isUseBlockIO()
protected int
poll()
protected void
resetClient()
void
setAwaitJob(boolean awaitJob)
void
setOnFailure(BeanstalkCommand onFailure)
void
setUseBlockIO(boolean useBlockIO)
-
Methods inherited from class org.apache.camel.support.ScheduledPollConsumer
afterPoll, beforePoll, doInit, doShutdown, doSuspend, getBackoffCounter, getBackoffErrorThreshold, getBackoffIdleThreshold, getBackoffMultiplier, getDelay, getInitialDelay, getPollStrategy, getRepeatCount, getRunLoggingLevel, getScheduledExecutorService, getScheduler, getSchedulerProperties, getTimeUnit, isGreedy, isPollAllowed, isPolling, isSchedulerStarted, isSendEmptyMessageWhenIdle, isStartScheduler, isUseFixedDelay, onInit, processEmptyMessage, run, setBackoffErrorThreshold, setBackoffIdleThreshold, setBackoffMultiplier, setDelay, setGreedy, setInitialDelay, setPollStrategy, setRepeatCount, setRunLoggingLevel, setScheduledExecutorService, setScheduler, setSchedulerProperties, setSendEmptyMessageWhenIdle, setStartScheduler, setTimeUnit, setUseFixedDelay, startScheduler
-
Methods inherited from class org.apache.camel.support.DefaultConsumer
createUoW, doneUoW, getAsyncProcessor, getExceptionHandler, getProcessor, getRoute, getRouteId, handleException, handleException, setExceptionHandler, setRoute, setRouteId, toString
-
Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doLifecycleChange, doResume, fail, 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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Constructor Detail
-
BeanstalkConsumer
public BeanstalkConsumer(BeanstalkEndpoint endpoint, org.apache.camel.Processor processor)
-
-
Method Detail
-
poll
protected int poll() throws Exception
- Specified by:
poll
in classorg.apache.camel.support.ScheduledPollConsumer
- Throws:
Exception
-
getOnFailure
public BeanstalkCommand getOnFailure()
-
setOnFailure
public void setOnFailure(BeanstalkCommand onFailure)
-
isUseBlockIO
public boolean isUseBlockIO()
-
setUseBlockIO
public void setUseBlockIO(boolean useBlockIO)
-
isAwaitJob
public boolean isAwaitJob()
-
setAwaitJob
public void setAwaitJob(boolean awaitJob)
-
getEndpoint
public BeanstalkEndpoint getEndpoint()
- Specified by:
getEndpoint
in interfaceorg.apache.camel.EndpointAware
- Overrides:
getEndpoint
in classorg.apache.camel.support.DefaultConsumer
-
doStart
protected void doStart() throws Exception
- Overrides:
doStart
in classorg.apache.camel.support.ScheduledPollConsumer
- Throws:
Exception
-
doStop
protected void doStop() throws Exception
- Overrides:
doStop
in classorg.apache.camel.support.ScheduledPollConsumer
- Throws:
Exception
-
resetClient
protected void resetClient()
-
-