congbobo184 commented on code in PR #18981:
URL: https://github.com/apache/pulsar/pull/18981#discussion_r1052827107
##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/MessageIdImpl.java:
##########
@@ -204,11 +204,13 @@ public byte[] toByteArray() {
@Override
public int compareTo(@Nonnull MessageId o) {
if (o instanceof MessageIdImpl) {
+ if (o instanceof BatchMessageIdImpl) {
+ throw new
UnsupportedOperationException(this.getClass().getName()
Review Comment:
We should forbit comparing the two types. This is not the correct behavior
for users. In what scenario will they compare BatchMessageId and MessageId? Now
that have decided to throw an exception, why not forbid it outright? if allow
some, forbid some, the user may use the wrong situation, which may exceed his
expectations and judgments
--
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]