未验证 提交 a386853b 编写于 作者: wu-sheng's avatar wu-sheng 提交者: GitHub

Force UTF-8 encoding in `JsonLogHandler` of `kafka-fetcher-plugin`. (#9927)

上级 9139a8f0
......@@ -103,6 +103,7 @@
* Fix `ClassCastException` in `LoggingConfigWatcher`.
* Support span attached event concept in Zipkin and SkyWalking trace query.
* Support span attached events on Zipkin lens UI.
* Force UTF-8 encoding in `JsonLogHandler` of `kafka-fetcher-plugin`.
#### UI
......
......@@ -19,6 +19,7 @@ package org.apache.skywalking.oap.server.analyzer.agent.kafka.provider.handler;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.common.utils.Bytes;
......@@ -50,7 +51,7 @@ public class JsonLogHandler extends LogHandler {
@Override
protected LogData parseConsumerRecord(ConsumerRecord<String, Bytes> record) throws IOException {
LogData.Builder logDataBuilder = LogData.newBuilder();
ProtoBufJsonUtils.fromJSON(record.value().toString(), logDataBuilder);
ProtoBufJsonUtils.fromJSON(new String(record.value().get(), StandardCharsets.UTF_8), logDataBuilder);
return logDataBuilder.build();
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册