Package org.apache.camel.resume
Interface ConsumerListener<C,P>
-
public interface ConsumerListener<C,P>
An interface for listening to consumer events and allow proxying between a consumer predicate and the Camel component. The whole of the consumer predicate is that of evaluating whether the consumption (from the internal Camel consumer) can continue or should be put on pause.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
afterConsume(C consumePayload)
This is an event that runs after data consumption.boolean
afterProcess(P processingPayload)
This is an event that runs after data processing.void
setResumableCheck(Predicate<?> afterConsumeEval)
This sets the predicate responsible for evaluating whether the processing can resume or not.
-
-
-
Method Detail
-
setResumableCheck
void setResumableCheck(Predicate<?> afterConsumeEval)
This sets the predicate responsible for evaluating whether the processing can resume or not. Such predicate should return true if the consumption can resume, or false otherwise. The exact point of when the predicate is called is dependent on the component, and it may be called on either one of the available events. Implementations should not assume the predicate to be called at any specific point.
-
afterConsume
boolean afterConsume(C consumePayload)
This is an event that runs after data consumption.- Parameters:
consumePayload
- the resume payload if any- Returns:
- true if the consumer should processing or false otherwise.
-
afterProcess
boolean afterProcess(P processingPayload)
This is an event that runs after data processing.- Parameters:
processingPayload
- the resume payload if any- Returns:
- true if the consumer should continue or false otherwise.
-
-