dlg99 opened a new issue #10022:
URL: https://github.com/apache/pulsar/issues/10022


   **Describe the bug**
   
   MessageImpl is out of sync with the documented behavior
   
   ```
   public interface Message<T> {
   ...
       /**
        * Get the unique message ID associated with this message.
        *
        * <p>The message id can be used to univocally refer to a message 
without having the keep
        * the entire payload in memory.
        *
        * <p>Only messages received from the consumer will have a message id 
assigned.
        *
        * @return the message id null if this message was not received by this 
client instance
        */
       MessageId getMessageId();
   ``` 
   note `return the message id null if ...`
   and then check
   
   ```
   public class MessageImpl<T> implements Message<T> {
   ...
       @Override
       public MessageId getMessageId() {
           checkNotNull(messageId, "Cannot get the message id of a message that 
was not received");
           return messageId;
       }
   ```    
      
   note `checkNotNull`
       
   **Expected behavior**
   
   Actual behavior to match documented behavior (one of these has to change). 
   
   


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