Hi Pulsar Community,

I want to discuss the return value of the
`org.apache.pulsar.client.admin.Topics#getMessageById`, which returns
`Message<byte[]>`. If the message is a batch message, we only get the first
message from the batch message.

So I want to change this behavior by returning `List<Message<byte[]>`, and
in the CLI, we also need to print multiple messages when using
`get-message-by-id`.

Now, I am adding a new method with the same name and a `batchIndex`
parameter. When "batchIndex" is -1, we can retrieve all messages from the
batch message. Otherwise, we get one message by giving the index. For this
implementation, please see  https://github.com/apache/pulsar/pull/21813.

In long time ago, there was also a PR to fix this issue, please see
https://github.com/apache/pulsar/pull/19827.

Two PR uses different ways to fix this issue, please let me know your
thoughts!

Thanks,
Zixuan

Reply via email to