Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UTF-8 Encoding? #35

Closed
amynguyen opened this issue Mar 31, 2014 · 5 comments
Closed

UTF-8 Encoding? #35

amynguyen opened this issue Mar 31, 2014 · 5 comments

Comments

@amynguyen
Copy link

When using UTF-8 encoding to support other languages such as Korean, messages that are placed in the Kafka queue seem to have the incorrect offset. When consuming the UTF-8 message out of the queue for every UTF-8 encoded character 2 bytes are missing off the end. The message looks good in the Kafka logs but when they are consumed that are missing x bytes off the end.

@haio
Copy link
Member

haio commented Apr 1, 2014

Could you please paste some code example here?

@amynguyen
Copy link
Author

Sample producer:

var kafka = require('kafka-node'),
Producer = kafka.Producer,
client = new kafka.Client('xxxxxxxxxxx:2181','testing'),
producer = new Producer(client),
payloads = [
{ topic: 'Test_1.0', messages: '{"korean":"추ㅏㅗㅑㅐㄹㄷ"}', partition: 0 }
];
producer.on('ready', function () {
producer.send(payloads, function (err, data) {
console.log(data);
});
})

Results from running the consumer in kafka/bin directory:
{"korean":"추ㅏㅗ

@haio
Copy link
Member

haio commented Apr 1, 2014

I can get the complete JSON from both Kafka-node consumer and the Kafka-console-consumer. Can you get the expected message using Kafka-node consumer?

@amynguyen
Copy link
Author

I just update to a newer version of kafka-node and this seems to be fixed.
Sorry.

On Tue, Apr 1, 2014 at 9:15 AM, Zhong Yu notifications@github.com wrote:

I can get the complete JSON from both Kafka-node consumer and the
Kafka-console-consumer. Can you get the expected message using Kafka-node
consumer?

Reply to this email directly or view it on GitHubhttps://github.com//issues/35#issuecomment-39225092
.

@haio
Copy link
Member

haio commented Apr 1, 2014

Good.

@haio haio closed this as completed Apr 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants