poorbarcode commented on code in PR #21423:
URL: https://github.com/apache/pulsar/pull/21423#discussion_r1432431640


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Dispatcher.java:
##########
@@ -129,6 +129,13 @@ default boolean checkAndUnblockIfStuck() {
         return false;
     }
 
+    /**
+     * A callback hook after acknowledge messages.
+     * If acknowledge successfully, {@param position} will not be null, and 
{@param position} and {@param ctx} will be
+     * null.
+     * If acknowledge failed. {@param position} will be null, and {@param 
position} and {@param ctx} will not be null.
+     */
+    default void afterAckMessages(Object position, Throwable error, Object 
ctx){}

Review Comment:
   > If it's inevitable. IMO, convert from the outside is better. From the 
API's perspective, we should have a more clear definition
   
   Sorry, after I've rearranged the context, I noticed that the first 
parameter(named `position`) shouldn't actually exist, the actual meaningful 
name is `ctx`(It just sets `ctx` with a `position` when calling the 
`deleteSync`).
   
   I changed the definition to `void afterAckMessages(Throwable error, Object 
ctx)`



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