org.apache.camel.component.aws.sqs
Class SqsConsumer
java.lang.Object
org.apache.camel.impl.ServiceSupport
org.apache.camel.impl.DefaultConsumer
org.apache.camel.impl.ScheduledPollConsumer
org.apache.camel.component.aws.sqs.SqsConsumer
- All Implemented Interfaces:
- Runnable, BatchConsumer, Consumer, Service, ShutdownableService, ShutdownAware, SuspendableService
public class SqsConsumer
- extends ScheduledPollConsumer
- implements BatchConsumer, ShutdownAware
A Consumer of messages from the Amazon Web Service Simple Queue Service
AWS SQS
- Version:
- $Revision: $
Methods inherited from class org.apache.camel.impl.ScheduledPollConsumer |
doStart, doStop, doSuspend, getDelay, getInitialDelay, getPollStrategy, getTimeUnit, isPollAllowed, isUseFixedDelay, run, setDelay, setInitialDelay, setPollStrategy, setTimeUnit, setUseFixedDelay |
Methods inherited from class org.apache.camel.impl.ServiceSupport |
addChildService, doResume, doShutdown, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspended, isSuspending, removeChildService, resume, shutdown, start, start, stop, suspend |
SqsConsumer
public SqsConsumer(SqsEndpoint endpoint,
Processor processor)
throws NoFactoryAvailableException
- Throws:
NoFactoryAvailableException
poll
protected int poll()
throws Exception
- Specified by:
poll
in class ScheduledPollConsumer
- Throws:
Exception
createExchanges
protected Queue<Exchange> createExchanges(List<com.amazonaws.services.sqs.model.Message> messages)
processBatch
public int processBatch(Queue<Object> exchanges)
throws Exception
- Specified by:
processBatch
in interface BatchConsumer
- Throws:
Exception
processCommit
protected void processCommit(Exchange exchange)
- Strategy to delete the message after being processed.
- Parameters:
exchange
- the exchange
processRollback
protected void processRollback(Exchange exchange)
- Strategy when processing the exchange failed.
- Parameters:
exchange
- the exchange
isBatchAllowed
public boolean isBatchAllowed()
- Specified by:
isBatchAllowed
in interface BatchConsumer
deferShutdown
public boolean deferShutdown(ShutdownRunningTask shutdownRunningTask)
- Specified by:
deferShutdown
in interface ShutdownAware
getPendingExchangesSize
public int getPendingExchangesSize()
- Specified by:
getPendingExchangesSize
in interface ShutdownAware
prepareShutdown
public void prepareShutdown()
- Specified by:
prepareShutdown
in interface ShutdownAware
getConfiguration
protected SqsConfiguration getConfiguration()
getClient
protected com.amazonaws.services.sqs.AmazonSQSClient getClient()
getQueueUrl
protected String getQueueUrl()
getEndpoint
public SqsEndpoint getEndpoint()
- Specified by:
getEndpoint
in interface Consumer
- Overrides:
getEndpoint
in class DefaultConsumer
setMaxMessagesPerPoll
public void setMaxMessagesPerPoll(int maxMessagesPerPoll)
- Specified by:
setMaxMessagesPerPoll
in interface BatchConsumer
getMaxMessagesPerPoll
public int getMaxMessagesPerPoll()
Apache CAMEL