Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added reflection on scheduledtaskrouter to get the errorhandler #224

Open
wants to merge 2 commits into
base: next
Choose a base branch
from

Conversation

clr182
Copy link
Contributor

@clr182 clr182 commented Sep 27, 2024

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 clr182 requested a review from lemnik September 27, 2024 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant