Jroland / kafka-net

Native C# client for Kafka queue servers.
Apache License 2.0
483 stars 232 forks source link

Timespan cast to Int32 #81

Open alastrange opened 8 years ago

alastrange commented 8 years ago

Producer's SendMessageAsync function accepts a TimeSpan as a timeout variable, and this is cast to int32 under the covers. I was using Timespan.MaxValue to simulate no timeout, but this unexpectedly timed out every request since it was cast to a negative number:

                    var request = new ProduceRequest
                    {
                        Acks = ackLevelBatch.Key.Acks,
                        TimeoutMS = (int)ackLevelBatch.Key.Timeout.TotalMilliseconds,
                        Payload = new List<Payload> { payload }
                    };