I think there are two parts about "lazy deserialization" that Penghui mentioned.
The first part is more about "delay deserialization" until the messages are consumed by the consumer applications. So you don't need to deserialize the objects immediately once the client receives it. The second part is you don't deserialize in data movement use cases. In a lot of such use cases, the applications are only replicating from destination A to destination B. they don't look into the data. Thanks, Sijie On Thu, Jul 18, 2019 at 4:48 AM Jerry Peng <jerry.boyang.p...@gmail.com> wrote: > Thanks for the reply. > > > Another benefit as mentioned in the last part of the proposal, this > can allow lazy deserialization and object > > We can do this but not sure how useful to users this will actually be. > In what scenario will a user read a batch of messages but not actually > want to examine the messages. To even look at the metadata of a > message, you will have to deserialize it. To even get the number of > messages in the batch you will have to deserialize the entry metadata. > > On Mon, Jul 15, 2019 at 6:41 PM PengHui Li <peng...@apache.org> wrote: > > > > Hi jerry, > > > > There are two important benefits: > > > > 1. It is a simple interface for users, without requiring user to make a > > message collector by himself. > > There are many scenarios where users will use batch processing. For > > example bulk insert database rows, > > if user goes to implement a bulk message collector, still need to > > consider maxNumMessages maxNumBytes > > and timeout of the message collector. > > 2. Another benefit as mentioned in the last part of the proposal, this > can > > allow lazy deserialization and object > > creation in the future. > > > > Thanks for your replay > > > > Regards, > > Penghui > > > > Jerry Peng <jerry.boyang.p...@gmail.com> 于2019年7月16日周二 上午2:58写道: > > > > > Hi Penghui, > > > > > > So what is the major benefit of using the proposed batch receive API > > > versus just buffering messages in my application code? In terms of > > > performance, consumers already receive messages as batches from the > > > broker. Though the current API only allows the user to retrieve a > > > message one at a time. > > > > > > Best, > > > > > > Jerry > > > > > > On Wed, Jul 3, 2019 at 11:18 PM PengHui Li <codelipeng...@gmail.com> > > > wrote: > > > > > > > > Dear all > > > > > > > > This is a PIP to add feature of batch receiving messages > > > > > > > > > https://github.com/apache/pulsar/wiki/PIP-38%3A-Batch-Receiving-Messages > > > > > > > > Please take a look. > > > > > > > > — > > > > Regards, > > > > Penghui Li > > > >