MarvinCai commented on a change in pull request #10025:
URL: https://github.com/apache/pulsar/pull/10025#discussion_r600188078
##########
File path:
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/Message.java
##########
@@ -81,7 +81,8 @@
*
* <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
+ * @return the message id
+ * @throws NullPointerException if the message is null (message was not
received by this client instance)
Review comment:
Seems returning null or throwing NPE is really opinion based. I think it
is important not to break client code, e.g. if client code is checking for NPE
and not doing null check then change to return null could possible cause NPE in
their program.
And I think we should also keep it consistent with other code in terms of
returning null or throw.
--
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]