T - the generic type for the generated message's payloadA - the generic type for the generated message's attributes@NoImplement @MinMuleVersion(value="4.4") public interface PollContext<T,A>
accept(Consumer) method. Depending on how the supplied PollContext.PollItem is configured, the runtime will automatically
apply watermarking, idempotency, etc.PollContext.PollItem| Modifier and Type | Interface and Description |
|---|---|
static interface |
PollContext.PollItem<T,A>
An item obtained through a poll
|
static class |
PollContext.PollItemStatus
The possible outcomes of submiting an item for processing through the
accept(Consumer) method |
| Modifier and Type | Method and Description |
|---|---|
PollContext.PollItemStatus |
accept(Consumer<PollContext.PollItem<T,A>> consumer)
Submits an item to be processed.
|
Optional<Serializable> |
getWatermark()
The current watermark value at the moment of starting the poll.
|
boolean |
isSourceStopping()
Whether the source has received the stopping signal.
|
void |
onConnectionException(org.mule.runtime.api.connection.ConnectionException e)
Equivalent to
SourceCallback.onConnectionException(ConnectionException). |
void |
setWatermarkComparator(Comparator<? extends Serializable> comparator)
Allows to set a custom
Comparator to evaluate watermark values. |
PollContext.PollItemStatus accept(Consumer<PollContext.PollItem<T,A>> consumer)
PollContext.PollItem in which the Result and other options
will be setconsumer - a Consumer of a PollContext.PollItemPollContext.PollItemStatusOptional<Serializable> getWatermark()
Optional.empty()boolean isSourceStopping()
void setWatermarkComparator(Comparator<? extends Serializable> comparator)
Comparator to evaluate watermark values. If not specified and Comparable values are
used as watermarks, then this method is only optional. Otherwise, exceptions will be thrown if a proper comparator was not
set.comparator - a custom ComparatorIllegalArgumentException - if the comparator is nullvoid onConnectionException(org.mule.runtime.api.connection.ConnectionException e)
SourceCallback.onConnectionException(ConnectionException). Should be used in the same circumstancese - a ConnectionExceptionCopyright © 2023. All rights reserved.