I've run into an issue when sending a set of messages to producer.SendMessageAsync such that the await Task.WhenAll statement seems to drop out before the tasks are complete. The function returns "{not yet computed}" for the Result and "Waiting for Activation" for the status. I do know that the sending of the data was successful, because the full dataset appeared within my Kafka application.
My solution to this problem was to simply make a synchronous version of the SendMessage function with the following signature:
I've run into an issue when sending a set of messages to producer.SendMessageAsync such that the await Task.WhenAll statement seems to drop out before the tasks are complete. The function returns "{not yet computed}" for the Result and "Waiting for Activation" for the status. I do know that the sending of the data was successful, because the full dataset appeared within my Kafka application.
My solution to this problem was to simply make a synchronous version of the SendMessage function with the following signature:
public List<ProduceResponse> SendMessage(string topic, IEnumerable<Message> messages, Int16 acks = 1, TimeSpan? timeout = null, MessageCodec codec = MessageCodec.CodecNone)
The only difference between this and the original function is that I used Task.WaitAll instead of await Task.WhenAll:
Task.WaitAll(batch.Select(x => x.Tcs.Task).ToArray());
So now the questions:
Thanks much.
Gary Lynn