Interface ProducerIterator<M extends Message>
-
- All Superinterfaces:
AutoCloseable
,Iterator<M>
- All Known Implementing Classes:
AbstractProducer
,FileBlobMessageProducer
,RandomDocumentMessageProducer
,RandomStringBlobMessageProducer
public interface ProducerIterator<M extends Message> extends Iterator<M>, AutoCloseable
A ProducerIterator returnsMessage
. It also has the logic to return a partition index, that will be used to run concurrent consumers.- Since:
- 9.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description int
getPartition(M message, int partitions)
Returns a partition associated with theMessage
.default void
remove()
The remove method is not needed.-
Methods inherited from interface java.lang.AutoCloseable
close
-
Methods inherited from interface java.util.Iterator
forEachRemaining, hasNext, next
-
-
-
-
Method Detail
-
remove
default void remove()
The remove method is not needed.
-
getPartition
int getPartition(M message, int partitions)
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
-
-