public interface PollingConsumer extends Consumer
Exchange you must ensure to invoke
UnitOfWork.done(Exchange) to signal to Camel that the Exchange is done.
This is needed to ensure any Synchronization works is being executed. For example if you
consumed from a file endpoint, then the consumed file is only moved/delete when you done the Exchange.
Important: Do not do any initialization in the constructor. Instead use
BaseService.doInit() or
BaseService.doStart().| Modifier and Type | Method and Description |
|---|---|
Exchange |
receive()
Waits until a message is available and then returns it.
|
Exchange |
receive(long timeout)
Attempts to receive a message exchange, waiting up to the given timeout to expire if a message is not yet
available.
|
Exchange |
receiveNoWait()
Attempts to receive a message exchange immediately without waiting and returning null if a message
exchange is not available yet.
|
createExchange, defaultConsumerCallback, getProcessor, releaseExchangegetEndpointExchange receive()
UnitOfWork on
the returned ExchangeExchange receiveNoWait()
UnitOfWork on
the returned ExchangeExchange receive(long timeout)
UnitOfWork on
the returned Exchangetimeout - the amount of time in milliseconds to wait for a message before timing out and returning
nullApache Camel