liudezhi2098 opened a new issue #6744: Produce encrypted messages, 
messageMetadata objects are not recycle
URL: https://github.com/apache/pulsar/issues/6744
 
 
   When producing encrypted messages for inspection, MessageMetadata objects 
are not released after they are created
   
   
   org.apache.pulsar.broker.service.Producer
   ```
    if (topic.isEncryptionRequired()) {
   
               headersAndPayload.markReaderIndex();
               MessageMetadata msgMetadata = 
Commands.parseMessageMetadata(headersAndPayload);
               headersAndPayload.resetReaderIndex();
               // Check whether the message is encrypted or not
               if (msgMetadata.getEncryptionKeysCount() < 1) {
                   log.warn("[{}] Messages must be encrypted", 
getTopic().getName());
                   cnx.ctx().channel().eventLoop().execute(() -> {
                       
cnx.ctx().writeAndFlush(Commands.newSendError(producerId, sequenceId, 
ServerError.MetadataError,
                               "Messages must be encrypted"));
                       cnx.completedSendOperation(isNonPersistentTopic, 
headersAndPayload.readableBytes());
                   });
                   return;
               }
           }
       }
   ```
   *MessageMetadata was not recycled*
   
   

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


With regards,
Apache Git Services

Reply via email to