I have setup two queues (calculator-webhook-queue & offers-queue) on Amazon SQS with the following code:-
In .env
file
QUEUE_CONNECTION=sqs
AWS_DEFAULT_REGION=us-east-1
AWS_ACCESS_KEY_ID=*******
AWS_SECRET_ACCESS_KEY=*******
SQS_PREFIX=*******
SQS_QUEUE=calculator-webhook-queue
In queue.php
config file
'connections' => [
'sqs' => [
'driver' => 'sqs',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'prefix' => env('SQS_PREFIX', ''),
'queue' => env('SQS_QUEUE', 'default'),
'suffix' => env('SQS_SUFFIX'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
'after_commit' => false,
]
],
In supervisor config file on Amazon server
[program:amazon-sqs]
directory=/var/www/html/****
command=php artisan queue:work sqs --queue=calculator-webhook-queue,offers-queue
process_name=%(program_name)s_%(process_num)02d
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
;user=web
numprocs=3
redirect_stderr=true
stdout_logfile=/var/www/html/****/storage/logs/amazon-sqs.log
stopwaitsecs=58
I have two jobs that are dispatched like this into separate queue
PropertyOffersJob::dispatch($webhookData)->onConnection('sqs')->onQueue('offers-queue');
PropertyTaxJob::dispatch($webhookData)->onConnection('sqs')->onQueue('calculator-webhook-queue');
Both are working fine but are only pushed to the same queue "calculator-webhook-queue". I want each to go to their respective queues. Please help me where I am messing?