public class MailConsumer
extends org.apache.camel.support.ScheduledBatchPollingConsumer
Consumer which consumes messages from JavaMail using a
Transport and dispatches them to the Processor| Modifier and Type | Field and Description |
|---|---|
static long |
DEFAULT_CONSUMER_DELAY |
static String |
MAIL_MESSAGE_UID |
| Constructor and Description |
|---|
MailConsumer(MailEndpoint endpoint,
org.apache.camel.Processor processor,
JavaMailSender sender) |
| Modifier and Type | Method and Description |
|---|---|
protected Queue<org.apache.camel.Exchange> |
createExchanges(List<org.apache.camel.util.KeyValueHolder<String,javax.mail.Message>> messages) |
protected void |
doStart() |
protected void |
doStop() |
MailEndpoint |
getEndpoint() |
boolean |
isHandleFailedMessage() |
boolean |
isSkipFailedMessage() |
protected int |
poll() |
int |
processBatch(Queue<Object> exchanges) |
protected void |
processCommit(javax.mail.Message mail,
org.apache.camel.Exchange exchange)
Strategy to flag the message after being processed.
|
protected void |
processExchange(org.apache.camel.Exchange exchange)
Strategy to process the mail message.
|
protected void |
processRollback(javax.mail.Message mail,
org.apache.camel.Exchange exchange)
Strategy when processing the exchange failed.
|
void |
setHandleFailedMessage(boolean handleFailedMessage) |
void |
setSkipFailedMessage(boolean skipFailedMessage) |
deferShutdown, getMaxMessagesPerPoll, getPendingExchangesSize, isBatchAllowed, prepareShutdown, processEmptyMessage, setMaxMessagesPerPollafterPoll, 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, run, setBackoffErrorThreshold, setBackoffIdleThreshold, setBackoffMultiplier, setDelay, setGreedy, setInitialDelay, setPollStrategy, setRepeatCount, setRunLoggingLevel, setScheduledExecutorService, setScheduler, setSchedulerProperties, setSendEmptyMessageWhenIdle, setStartScheduler, setTimeUnit, setUseFixedDelay, startSchedulercreateUoW, doneUoW, getAsyncProcessor, getExceptionHandler, getProcessor, getRoute, getRouteId, handleException, handleException, setExceptionHandler, setRoute, setRouteId, toStringbuild, 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, suspendclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic static final String MAIL_MESSAGE_UID
public static final long DEFAULT_CONSUMER_DELAY
public MailConsumer(MailEndpoint endpoint, org.apache.camel.Processor processor, JavaMailSender sender)
protected void doStart()
throws Exception
doStart in class org.apache.camel.support.ScheduledPollConsumerExceptionprotected void doStop()
throws Exception
doStop in class org.apache.camel.support.ScheduledPollConsumerExceptionprotected int poll()
throws Exception
poll in class org.apache.camel.support.ScheduledPollConsumerExceptionprotected Queue<org.apache.camel.Exchange> createExchanges(List<org.apache.camel.util.KeyValueHolder<String,javax.mail.Message>> messages) throws javax.mail.MessagingException
javax.mail.MessagingExceptionprotected void processExchange(org.apache.camel.Exchange exchange)
throws Exception
Exceptionprotected void processCommit(javax.mail.Message mail,
org.apache.camel.Exchange exchange)
mail - the mail messageexchange - the exchangeprotected void processRollback(javax.mail.Message mail,
org.apache.camel.Exchange exchange)
mail - the mail messageexchange - the exchangepublic MailEndpoint getEndpoint()
getEndpoint in interface org.apache.camel.EndpointAwaregetEndpoint in class org.apache.camel.support.DefaultConsumerpublic boolean isSkipFailedMessage()
public void setSkipFailedMessage(boolean skipFailedMessage)
public boolean isHandleFailedMessage()
public void setHandleFailedMessage(boolean handleFailedMessage)
Apache Camel