BewareMyPower commented on issue #12087:
URL: https://github.com/apache/pulsar/issues/12087#issuecomment-928651728


   @eolivelli Regarding to the `numMessages` parameter, I found it's still 
necessary when I tried to remove it.
   
   The entry context is based on the `MessageMetadata`. However, the actual 
number of messages might be contained in the payload. For example, if the 
message was published from KoP, the actual metadata is contained in the payload 
and the `MessageMetadata` is a false header. In this case, we need to parse the 
payload, then pass the actual number of messages.
   
   Similarly, these methods are all based on `MessageMetadata`:
   
   ```java
   public interface EntryContext {
   
       String getProperty(String key);
   
       int getNumMessages();
   
       boolean isBatch();
   ```
   
   That's also one of the reasons that I renamed the `MessageContext` to 
`EntryContext`. Because the context of the entry might not be the same context 
of the message.


-- 
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]


Reply via email to