Package org.apache.camel
Interface PollingConsumerPollingStrategy
public interface PollingConsumerPollingStrategy
Strategy that allows
Consumer
s to influence the PollingConsumer
.
For example this is used by schedule based consumers to be able to suspend/resume upon polling using a
PollingConsumer
.- See Also:
-
org.apache.camel.support.EventDrivenPollingConsumer
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Callback invoked after the poll.long
beforePoll
(long timeout) Callback invoked before the poll.void
onInit()
Callback invoked when the consumer is initialized such as when thePollingConsumer
starts.
-
Method Details
-
onInit
Callback invoked when the consumer is initialized such as when thePollingConsumer
starts.- Throws:
Exception
- can be thrown if error initializing.
-
beforePoll
Callback invoked before the poll.- Parameters:
timeout
- the timeout- Returns:
- timeout to be used, this allows returning a higher timeout value to ensure at least one poll is being performed
- Throws:
Exception
- can be thrown if error occurred
-
afterPoll
Callback invoked after the poll.- Throws:
Exception
- can be thrown if error occurred
-