merlimat commented on a change in pull request #11524: URL: https://github.com/apache/pulsar/pull/11524#discussion_r680393493
########## File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java ########## @@ -2364,7 +2365,12 @@ public ByteBufPair newMessageAndIntercept(long consumerId, long ledgerId, long e ackSet); ByteBufPair res = Commands.serializeCommandMessageWithSize(command, metadataAndPayload); try { - getBrokerService().getInterceptor().onPulsarCommand(command, this); + val brokerInterceptor = getBrokerService().getInterceptor(); Review comment: If `getInterceptor()` can return a null, it would also be good to return `Optional<Interceptor>` instead -- 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