Interface ProducerIterator<M extends Message>
- All Superinterfaces:
AutoCloseable,Iterator<M>
- All Known Implementing Classes:
AbstractProducer,FileBlobMessageProducer,RandomDocumentMessageProducer,RandomStringBlobMessageProducer
A ProducerIterator returns
Message. It also has the logic to return a partition index, that will be used to
run concurrent consumers.- Since:
- 9.1
-
Method Summary
Modifier and TypeMethodDescriptionintgetPartition(M message, int partitions) Returns a partition associated with theMessage.default voidremove()The remove method is not needed.Methods inherited from interface java.lang.AutoCloseable
closeMethods inherited from interface java.util.Iterator
forEachRemaining, hasNext, next
-
Method Details
-
remove
default void remove()The remove method is not needed. -
getPartition
Returns a partition associated with theMessage. The value returned must be between 0 and lower than partitions.- Parameters:
message- the message to shardpartitions- the number of partitions
-