Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more

package org.apache.flume.sink.kafka;

import com.google.common.base.Charsets;
import com.google.common.base.Optional;
import com.google.common.base.Throwables;
import org.apache.avro.io.BinaryEncoder;
Expand Down Expand Up @@ -437,7 +438,7 @@ private void setProducerProps(Context context, String bootStrapServers) {
private Headers toKafkaHeaders(Map<String, String> headers) {
Headers kafkaHeaders = new RecordHeaders();
for (Entry<String, String> header : headers.entrySet()) {
kafkaHeaders.add(header.getKey(), header.getValue().getBytes());
kafkaHeaders.add(header.getKey(), header.getValue().getBytes(Charsets.UTF_8));

@slem1 slem1 Sep 3, 2019

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think expected Charsets should be configurable through flume context parameters

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1

}
return kafkaHeaders;
}
Expand Down