You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2019/06/14 10:42:53 UTC

[GitHub] [pulsar] sijie commented on a change in pull request #4517: Fix NPE of ProducerInterceptors

sijie commented on a change in pull request #4517: Fix NPE of ProducerInterceptors
URL: https://github.com/apache/pulsar/pull/4517#discussion_r293755707
 
 

 ##########
 File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerInterceptors.java
 ##########
 @@ -64,8 +64,8 @@ public ProducerInterceptors(List<ProducerInterceptor<T>> interceptors) {
             try {
                 interceptorMessage = interceptors.get(i).beforeSend(producer, interceptorMessage);
             } catch (Exception e) {
-                if (message != null && producer != null) {
-                    log.warn("Error executing interceptor beforeSend callback for messageId: {}, topicName:{} ", message.getMessageId(), producer.getTopic(), e);
+                if (producer != null) {
 
 Review comment:
   @jerrypeng `getMessageId` throws NPE if message id is null. If a message is not sent to brokers, it will not have message id. so it doesn't make sense to call get message id before sending. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services