liangyepianzhou commented on code in PR #24102:
URL: https://github.com/apache/pulsar/pull/24102#discussion_r2011711686


##########
pulsar-broker/src/test/java/org/apache/pulsar/client/impl/ProducerConsumerInternalTest.java:
##########
@@ -275,5 +275,20 @@ public void testProducerCompressionMinMsgBodySize() throws 
PulsarClientException
         message = (MessageImpl<byte[]>) consumer.receive();
         compressionType = message.getCompressionType();
         assertEquals(compressionType, CompressionType.LZ4);
+
+        // Verify data integrity
+        String data = "compression test message";
+        producer.conf.setBatchingEnabled(true);
+        producer.getConfiguration().setCompressMinMsgBodySize(1);
+        producer.newMessage().value(data.getBytes()).send();
+        message = (MessageImpl<byte[]>) consumer.receive();
+        assertEquals(new String(message.getData()), data);
+
+        producer.conf.setBatchingEnabled(false);
+        producer.getConfiguration().setCompressMinMsgBodySize(1);
+        producer.newMessage().value(data.getBytes()).send();
+        message = (MessageImpl<byte[]>) consumer.receive();
+        assertEquals(new String(message.getData()), data);

Review Comment:
   Thanks for the reminder, I modified the test to cover this case



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to