Implement toString() method for TopicMessageIdImpl class (#7807)
### Motivation Currently, the `TopicMessageIdImpl` class does not override the `toString()` method. Therefore, even if the ID of a message received from a partitioned topic is output to the log, we can only know the ID of the Java object. ```java LOG.info("Received: {} (ID: {})", new String(msg.getData()), msg.getMessageId()); ``` ``` 15:57:17.759 [main] INFO SampleConsumer - Received: msg0 (ID: org.apache.pulsar.client.impl.TopicMessageIdImpl@e35239b1) 15:57:17.760 [main] INFO SampleConsumer - Received: msg1 (ID: org.apache.pulsar.client.impl.TopicMessageIdImpl@e3523a0e) 15:57:17.761 [main] INFO SampleConsumer - Received: msg2 (ID: org.apache.pulsar.client.impl.TopicMessageIdImpl@e3523d72) 15:57:17.762 [main] INFO SampleConsumer - Received: msg3 (ID: org.apache.pulsar.client.impl.TopicMessageIdImpl@e3524133) 15:57:17.762 [main] INFO SampleConsumer - Received: msg4 (ID: org.apache.pulsar.client.impl.TopicMessageIdImpl@e3523dcf) ``` ### Modifications Added the `toString()` method to the `TopicMessageIdImpl` class. This method returns the result of converting the `MessageId` instance held internally to a string.
Showing
想要评论请 注册 或 登录