bugsnag-java icon indicating copy to clipboard operation
bugsnag-java copied to clipboard

added reflection on scheduledtaskrouter to get the errorhandler

Open clr182 opened this issue 1 year ago • 0 comments

Goal

To fix warning: com.bugsnag.ScheduledTaskConfiguration : TaskScheduler of type org.springframework.scheduling.config.TaskSchedulerRouter does not support errorHandler configuration

Design

Uses reflection to identify the scheduler's type, supporting both proxied instances and nested delegate schedulers. Tries to ensure error handling by unwrapping TaskSchedulerRouter instances and logging any configuration issues.

Changeset

  • updated configureExistingTaskScheduler method to support reflection-based type-checking for TaskScheduler.
  • Implemented the unwrapRouter method to handle TaskSchedulerRouter instances by accessing the defaultScheduler field.
  • Improved logging for better diagnostics during the configuration process.

Testing

Tested manually running the example application with the @enabledScheduling annotation.

clr182 avatar Sep 27 '24 14:09 clr182