[FEATURE REQ] More useful exception logging when user-exceptions occurs i processEvent callback in EventProcessorClient #42082
Labels
Client
This issue points to a problem in the data-plane of the library.
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
Event Hubs
needs-team-attention
Workflow: This issue needs attention from Azure service team or SDK team
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Is your feature request related to a problem? Please describe.
Currently [artifactId=azure-messaging-eventhubs, groupId=com.azure, version=5.18.7] when an exception is thrown in com.azure.messaging.eventhubs.implementation.PartitionProcessor#processEvent, there will be logged 4 exceptions.
These are Error in event processing callback(x3) and Scheduler worker in group main failed with an uncaught exception.
Only the latter of these provide useful stacktrace for debugging, but the message itself isnt too helpful.
Describe the solution you'd like
I would like to have the amount of logged exceptions reduced to one and for that particular exception to provide a more useful error message.
To reduce the amount of exceptions logged I do believe that a solution is to only wrap and not log the caught exception in com.azure.messaging.eventhubs.PartitionPumpManager#processEvent. The same goes for com.azure.messaging.eventhubs.PartitionPumpManager#processEvents.
To provide a more useful error message I think the reactive chain in com.azure.messaging.eventhubs.PartitionPumpManager#startPartitionPump need to handle exceptions being thrown in the .subscribe callbacks. I believe the most straight forward way is to wrap the processEvents method in a try catch and handle the exception with the same logic as in the outer catch clause in com.azure.messaging.eventhubs.PartitionPumpManager#startPartitionPump.
Describe alternatives you've considered
Just ignore the duplicate errors
Information Checklist
The text was updated successfully, but these errors were encountered: