0

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', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
            '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?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.