This week, the Laravel team released version 10.39 with a round-robin mailer, dynamic maximum attempts for queue jobs, and more. Here's a brief overview of the new features introduced in Laravel v10.39 this week:
Round-robin Mailer:
Ahmed Shamim contributed to a round-robin mailer transport driver that distributes delivery workloads across multiple transports. In simple terms, this driver extends the failover transport driver by changing the logic for selecting the next transport. The failover driver helps achieve high availability, while round-robin helps achieve load balancing.
To use this feature, update your application configuration in the config/mail.php file in your Laravel application:
'roundrobin' => [ 'transport' => 'roundrobin', 'mailers' => [ 'ses', 'postmark', ], ],
This feature is documented in the official Mail documentation on round-robin configuration. You can learn more in Symfony Mailer's load balancing documentation and Pull Request #49435.
Dynamic Maximum Attempts for Queue Jobs:
@Di contributed the ability to dynamically determine maxTries for queue jobs, similar to backoff(). Previously, you could set a dynamic value through the $tries property (which still takes precedence), but now you can define a method on your job:
class TestJob implements ShouldQueue { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; // If the property is still defined, it precedes over the tries() method, // providing the same behavior as the backoff definition public $tries = 3; public function tries(): int { return config('test_job.retries'); // Example: Get the number of tries from config } }
Release Notes:
You can find the complete list of new features and updates below, and the differences between versions 10.38.0 and 10.39.0 on GitHub. The release notes below are directly from the changelog:
v10.39.0
- [9.x] Support for phpredis 6.0.0 by @MichalHubatka at https://github.com/laravel/framework/pull/48380
- [10.x] Dynamic maximum attempts for queue jobs by @mechelon at https://github.com/laravel/framework/pull/49473
- [10.x] Avoid TypeError when using json validation rules with PHP < 8.3 by @Xint0 at https://github.com/laravel/framework/pull/49474
- [10.x] Fix compilation of use statements in Blade templates by @MrPunyapal at https://github.com/laravel/framework/pull/49479
- [10.x] Allow validation prompt testing by @cerbero90 at https://github.com/laravel/framework/pull/49447
- [10.x] Add 'Roundrobin' transport driver for Symfony mailer by @me-shaon at https://github.com/laravel/framework/pull/49435
0 comments:
Post a Comment