You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered: