You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/02/18 17:22:32 UTC

[GitHub] [pulsar] lhotari commented on a change in pull request #9608: Fix writing/encoding of GenericJsonRecord

lhotari commented on a change in pull request #9608:
URL: https://github.com/apache/pulsar/pull/9608#discussion_r578605935



##########
File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/schema/generic/GenericJsonWriter.java
##########
@@ -36,7 +38,11 @@ public GenericJsonWriter() {
     @Override
     public byte[] write(GenericRecord message) {
         try {
-            return objectMapper.writeValueAsBytes(((GenericJsonRecord)message).getJsonNode().toString());
+            ByteArrayOutputStream buffer = new ByteArrayOutputStream();

Review comment:
       @MarvinCai thanks for the heads up. I was overdoing it. :) I pushed a fix where I simply dropped `.toString()`, as you had already pointed out in the issue report. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org