bugsnag-java
bugsnag-java copied to clipboard
added reflection on scheduledtaskrouter to get the errorhandler
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
configureExistingTaskSchedulermethod 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.