Skip to main content
Version: 3.x

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)
parameterdescription
producerThe producer instance
itemsAll messages to produce
throwIfAnyProduceFailindicates 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