apache / pulsar

Apache Pulsar - distributed pub-sub messaging system
https://pulsar.apache.org/
Apache License 2.0
14.26k stars 3.59k forks source link

[improve][consumer] Optimizing Exception Handling and Logging in `MultiTopicsConsumerImpl` #23568

Open ZhaoGuorui666 opened 1 week ago

ZhaoGuorui666 commented 1 week ago

Motivation

  1. Generic Exception Handling:

    • The internalReceive method currently catches all exceptions, which can obscure the root cause of specific failures, such as invalid message types.
  2. Insufficient Logging for Validation Failures:

    • When Preconditions.checkArgument fails (throwing an IllegalArgumentException), the existing implementation does not log detailed information about the failure. This limitation makes it challenging to diagnose issues related to message type mismatches.

Modifications

Verifying this change

Documentation