BatchProduceExtension.BatchProduceAsync method
Calls the Produce() method in loop for high throughput scenarios
public static Task<IReadOnlyCollection<BatchProduceItem>> BatchProduceAsync(
this IMessageProducer producer, IReadOnlyCollection<BatchProduceItem> items,
bool throwIfAnyProduceFail = true)
parameter | description |
---|---|
producer | The producer instance |
items | All messages to produce |
throwIfAnyProduceFail | indicates if the method should throw a BatchProduceException if any message fail |
Return Value
A Task that will be marked as completed when all produce operations end
See Also
- class BatchProduceItem
- interface IMessageProducer
- class BatchProduceExtension
- namespace KafkaFlow.Producers