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 2022/12/25 02:44:32 UTC

[GitHub] [pulsar] tisonkun commented on a diff in pull request #19051: [fix][broker] retry letter producer respect auto schema

tisonkun commented on code in PR #19051:
URL: https://github.com/apache/pulsar/pull/19051#discussion_r1056893395


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java:
##########
@@ -672,8 +672,10 @@ protected CompletableFuture<Void> doReconsumeLater(Message<?> message, AckType a
                         return null;
                     });
                 } else {
-                    TypedMessageBuilder<T> typedMessageBuilderNew = retryLetterProducer.newMessage()
-                            .value(retryMessage.getValue())
+                    assert retryMessage != null;
+                    TypedMessageBuilder<byte[]> typedMessageBuilderNew = retryLetterProducer
+                            .newMessage(Schema.AUTO_PRODUCE_BYTES(message.getReaderSchema().get()))

Review Comment:
   This line is copied from how we work for deadletter, I'm wondering whether it can produce NPE at `message.getReaderSchema().get()`. cc @congbobo184 



##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java:
##########
@@ -672,8 +672,10 @@ protected CompletableFuture<Void> doReconsumeLater(Message<?> message, AckType a
                         return null;
                     });
                 } else {
-                    TypedMessageBuilder<T> typedMessageBuilderNew = retryLetterProducer.newMessage()
-                            .value(retryMessage.getValue())
+                    assert retryMessage != null;
+                    TypedMessageBuilder<byte[]> typedMessageBuilderNew = retryLetterProducer
+                            .newMessage(Schema.AUTO_PRODUCE_BYTES(message.getReaderSchema().get()))

Review Comment:
   This line is copied from how we work for deadletter. I'm wondering whether it can produce NPE at `message.getReaderSchema().get()`. cc @congbobo184 



-- 
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-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org