Jason918 commented on code in PR #17269:
URL: https://github.com/apache/pulsar/pull/17269#discussion_r962587534


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/intercept/BrokerInterceptors.java:
##########
@@ -93,17 +93,31 @@ public static BrokerInterceptor load(ServiceConfiguration 
conf) throws IOExcepti
         }
     }
 
+    @Override
+    public void onMessagePublish(Producer producer,
+                                 ByteBuf headersAndPayload,
+                                 Topic.PublishContext publishContext) {
+        for (BrokerInterceptorWithClassLoader value : interceptors.values()) {

Review Comment:
   Should check interceptors is null?



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



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