aloyszhang commented on code in PR #17269: URL: https://github.com/apache/pulsar/pull/17269#discussion_r962738661
########## pulsar-broker/src/main/java/org/apache/pulsar/broker/intercept/BrokerInterceptor.java: ########## @@ -64,6 +64,22 @@ default void beforeSendMessage(Subscription subscription, MessageMetadata msgMetadata) { } + /** + * Intercept messages before sending them to the consumers. + * + * @param subscription pulsar subscription + * @param entry entry + * @param ackSet entry ack bitset. it is either <tt>null</tt> or an array of long-based bitsets. + * @param msgMetadata message metadata. The message metadata will be recycled after this call. + * @param consumer consumer. Consumer which entry are sent to. + */ + default void beforeSendMessage(Subscription subscription, Review Comment: > There are two methods named beforeSendMessage. What happens when user implemented both of them? If both of these two methods are implemented, only the new one takes effect since in the `AbastractDispatcher` invokes the new method `interceptor.beforeSendMessage(subscription, entry, ackSet, msgMetadata, consumer)` Also, this is compatible with the original method without the consumer parameter. -- 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: commits-unsubscr...@pulsar.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org