Describe the bug
Given to MessageIds, of which one happens to be a MessageIdImpl and the other is a BatchMessageIdImpl, the compare method is not symmetric.
To Reproduce
import static org.assertj.core.api.Assertions.assertThat;
@Test
public void shouldBeSymmetric() {
MessageIdImpl simpleMessageId = new MessageIdImpl(1, 2, 3);
BatchMessageIdImpl batchMessageId = new BatchMessageIdImpl(1, 2, 3, 0);
assertThat(simpleMessageId.compareTo(batchMessageId)).isEqualTo(batchMessageId.compareTo(simpleMessageId));
}
Expected behavior
MessageId#compare should be symmetric
Additional context
Pulsar 2.5.0
Describe the bug
Given to
MessageIds, of which one happens to be aMessageIdImpland the other is aBatchMessageIdImpl, the compare method is not symmetric.To Reproduce
Expected behavior
MessageId#compare should be symmetric
Additional context
Pulsar 2.5.0