Kafka 0.9 producer fix - #22
Conversation
Adding a space for DefaultClientId was required for kafkanet to work with Kafka 0.9 https://issues.apache.org/jira/browse/KAFKA-3088
Added comment so no one is tempted to remove space at a later point
|
John Stark (@johnstark) -- FYI, the PR verification build fails with this change. Is there some way to make this code support both Kafka 0.8 and 0.9? |
|
Jorgen Thelin (@jthelin), we did verify the fix and it is working with Kafka 0.8 and 0.9. It turns out the mock in this case was assuming the empty string and a space is precisely what the fix required. I just checked in another PR that fixes the mocks. |
| public const int DefaultCorrelationId = -1; | ||
|
|
||
| public const string DefaultClientId = ""; | ||
| public const string DefaultClientId = " "; |
There was a problem hiding this comment.
John Stark (@johnstark) , Can we set it to something less obscure?
Java api does something like following which could help while debugging.
if (clientId.length() <= 0)
clientId = "producer-" + PRODUCER_CLIENT_ID_SEQUENCE.getAndIncrement();
Adding a space for DefaultClientId was required for kafkanet to work with Kafka 0.9. https://issues.apache.org/jira/browse/KAFKA-3088
With this fix: able to successfully produce messages from kafkanet to 0.9 and used the 0.9 Java consumer to consume them.