This repository was archived by the owner on Jul 15, 2023. It is now read-only.
Open
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
Contributor
|
@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? |
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. |
| public const int DefaultCorrelationId = -1; | ||
|
|
||
| public const string DefaultClientId = ""; | ||
| public const string DefaultClientId = " "; |
Contributor
There was a problem hiding this comment.
@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();
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.