@@ -290,15 +290,6 @@ public ByteBuffer encode(final MessageExtBatch messageExtBatch, PutMessageContex
290290 throw new RuntimeException ("message body size exceeded" );
291291 }
292292
293- // properties from MessageExtBatch
294- String batchPropStr = MessageDecoder .messageProperties2String (messageExtBatch .getProperties ());
295- final byte [] batchPropData = batchPropStr .getBytes (MessageDecoder .CHARSET_UTF8 );
296- int batchPropDataLen = batchPropData .length ;
297- if (batchPropDataLen > Short .MAX_VALUE ) {
298- CommitLog .log .warn ("Properties size of messageExtBatch exceeded, properties size: {}, maxSize: {}." , batchPropDataLen , Short .MAX_VALUE );
299- throw new RuntimeException ("Properties size of messageExtBatch exceeded!" );
300- }
301- final short batchPropLen = (short ) batchPropDataLen ;
302293
303294 int batchSize = 0 ;
304295 while (messagesByteBuff .hasRemaining ()) {
@@ -320,14 +311,11 @@ public ByteBuffer encode(final MessageExtBatch messageExtBatch, PutMessageContex
320311 short propertiesLen = messagesByteBuff .getShort ();
321312 int propertiesPos = messagesByteBuff .position ();
322313 messagesByteBuff .position (propertiesPos + propertiesLen );
323- boolean needAppendLastPropertySeparator = propertiesLen > 0 && batchPropLen > 0
324- && messagesByteBuff .get (messagesByteBuff .position () - 1 ) != MessageDecoder .PROPERTY_SEPARATOR ;
325314
326315 final byte [] topicData = messageExtBatch .getTopic ().getBytes (MessageDecoder .CHARSET_UTF8 );
327316
328317 final int topicLength = topicData .length ;
329- int totalPropLen = needAppendLastPropertySeparator ?
330- propertiesLen + batchPropLen + 1 : propertiesLen + batchPropLen ;
318+ int totalPropLen = propertiesLen ;
331319
332320 // properties need to add crc32
333321 totalPropLen += crc32ReservedLength ;
@@ -386,12 +374,6 @@ public ByteBuffer encode(final MessageExtBatch messageExtBatch, PutMessageContex
386374 if (propertiesLen > 0 ) {
387375 this .byteBuf .writeBytes (messagesByteBuff .array (), propertiesPos , propertiesLen );
388376 }
389- if (batchPropLen > 0 ) {
390- if (needAppendLastPropertySeparator ) {
391- this .byteBuf .writeByte ((byte ) MessageDecoder .PROPERTY_SEPARATOR );
392- }
393- this .byteBuf .writeBytes (batchPropData , 0 , batchPropLen );
394- }
395377 this .byteBuf .writerIndex (this .byteBuf .writerIndex () + crc32ReservedLength );
396378 }
397379 putMessageContext .setBatchSize (batchSize );
0 commit comments