public interface ProducerIterator<M extends Message> extends Iterator<M>, AutoCloseable
Message
.
It also has the logic to return a partition index, that will be used to run concurrent consumers.Modifier and Type | Method and Description |
---|---|
int |
getPartition(M message,
int partitions)
Returns a partition associated with the
Message . |
default void |
remove()
The remove method is not needed.
|
forEachRemaining, hasNext, next
close
default void remove()
int getPartition(M message, int partitions)
Message
.
The value returned must be between 0 and lower than partitions.message
- the message to shardpartitions
- the number of partitionsCopyright © 2017 Nuxeo. All rights reserved.