laravel job queue 에서 queue name 분리하기
Updated on
- laravel Job File
public function __construct()
{
$this->onQueue('payment');
}- laravel horizon config File
'supervisor-2' => [
'connection' => 'redis',
'queue' => ['payment'],
],job queue 에서 분리가 필요할때가 있다.
https://laravel.com/docs/10.x/queues#customizing-the-queue-and-connection
라라벨 공식 문서에서 확인해보면 onQueue 를 dispatch 에서 사용하라고 되어있는데, 이렇게 사용하게 되면, 생각보다 번거로워질수도 있다.
그래서 Job File에 지정해주면 해당 Job은 무조건 해당 queue name 으로 처리되게 된다.