Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Kafka 0.9 producer fix #22

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

johnstark
Copy link
Contributor

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.

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
@jthelin
Copy link
Contributor

jthelin commented Mar 8, 2016

@johnstark -- FYI, the PR verification build fails with this change.
https://ci.appveyor.com/project/skillrat/kafkanet/build/1.0.0.14-ystcjvtw

Is there some way to make this code support both Kafka 0.8 and 0.9?

@johnstark
Copy link
Contributor Author

@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.

@@ -35,7 +35,7 @@ public class SyncProducerConfiguration : ISyncProducerConfigShared

public const int DefaultCorrelationId = -1;

public const string DefaultClientId = "";
public const string DefaultClientId = " ";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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();

@microsoft microsoft deleted a comment from msftclas Sep 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants