lhotari commented on code in PR #24663:
URL: https://github.com/apache/pulsar/pull/24663#discussion_r2297320832


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java:
##########
@@ -2365,9 +2367,15 @@ private CompletableFuture<Boolean> 
processPossibleToDLQ(MessageIdAdv messageId)
                                     return null;
                                 });
                     } catch (Exception e) {
-                        log.warn("[{}] [{}] [{}] Failed to send DLQ message to 
{} for message id {}",
+                        log.warn("[{}] [{}] [{}] Failed to process DLQ message 
to {} for message id {}",
                                 topicName, subscription, consumerName, 
deadLetterPolicy.getDeadLetterTopic(), messageId,
                                 e);
+                        if (e instanceof SchemaSerializationException) {
+                            // If a SchemaSerializationException occurs, the 
message should be ignored to redelivery.
+                            // Otherwise, it will be redelivered and still 
can't send to the DLQ
+                            // and cause an infinite loop
+                            result.complete(true);

Review Comment:
   @3pacccccc In 
https://github.com/apache/pulsar/issues/20635#issuecomment-2577625071 I have 
shared a suggestion: 
   > Most likely there would need to be a separate mode for AUTO_PRODUCE_BYTES 
where it can be chosen on the client side to skip schema validation. That 
feature is also useful in other use cases since it can reduce CPU usage on the 
client side when schema validation is skipped at producing time.
   
   I'm referring to skipping `schema.validate(message)` here:
   
https://github.com/apache/pulsar/blob/da0d11644f097ae657e79b2eb7835478d79ccd0e/pulsar-client/src/main/java/org/apache/pulsar/client/impl/schema/AutoProduceBytesSchema.java#L70-L85
   
   



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