From cb11fd2900f1b05136e072335361e4e19813c82b Mon Sep 17 00:00:00 2001 From: jianhaiqing Date: Tue, 22 Oct 2024 11:16:45 +0800 Subject: [PATCH] fix https://github.com/apache/rocketmq-exporter/issues/56 --- .../rocketmq/exporter/controller/RMQMetricsController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/apache/rocketmq/exporter/controller/RMQMetricsController.java b/src/main/java/org/apache/rocketmq/exporter/controller/RMQMetricsController.java index e6fe31c..3b19d8e 100644 --- a/src/main/java/org/apache/rocketmq/exporter/controller/RMQMetricsController.java +++ b/src/main/java/org/apache/rocketmq/exporter/controller/RMQMetricsController.java @@ -40,6 +40,6 @@ private void metrics(HttpServletResponse response) throws IOException { StringWriter writer = new StringWriter(); metricsService.metrics(writer); response.setHeader("Content-Type", "text/plain; version=0.0.4; charset=utf-8"); - response.getOutputStream().print(writer.toString()); + response.getOutputStream().write(writer.toString().getBytes("utf-8")); } }