BewareMyPower commented on a change in pull request #9255:
URL: https://github.com/apache/pulsar/pull/9255#discussion_r561770149



##########
File path: 
pulsar-common/src/main/java/org/apache/pulsar/common/protocol/Commands.java
##########
@@ -1660,6 +1661,26 @@ public static MessageMetadata 
peekMessageMetadata(ByteBuf metadataAndPayload, St
         }
     }
 
+    public static final String NONE_KEY = "NONE_KEY";
+    public static byte[] peekStickyKey(ByteBuf metadataAndPayload, String 
topic, String subscription) {
+        try {
+            int readerIdx = metadataAndPayload.readerIndex();
+            skipBrokerEntryMetadataIfExist(metadataAndPayload);
+            MessageMetadata metadata = 
Commands.parseMessageMetadata(metadataAndPayload);
+            metadataAndPayload.readerIndex(readerIdx);
+            byte[] key = NONE_KEY.getBytes();

Review comment:
       I think we should also use `getBytes(StandardCharsets.UTF_8)` here.




----------------------------------------------------------------
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:
[email protected]


Reply via email to