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

Can I using multiple connections for sending or listen queues? #42

Open
gemaralali opened this issue Dec 31, 2019 · 3 comments
Open

Can I using multiple connections for sending or listen queues? #42

gemaralali opened this issue Dec 31, 2019 · 3 comments

Comments

@gemaralali
Copy link

gemaralali commented Dec 31, 2019

I am using PHP >=5.6.4 & Lumen 5.5.* & laravel-plain-sqs ^0.1.16

in config/queue.php

'connections' => [ 'sqs-plain' => [ 'driver' => 'sqs-plain', 'key' => env('SQS_KEY', 'key'), 'secret' => env('SQS_SECRET', 'secret'), 'prefix' => env('SQS_PREFIX', 'prefix'), 'queue' => env('SQS_URL', 'queue'), 'region' => env('SQS_REGION', 'region'), ], 'sqs-plain-2' => [ 'driver' => 'sqs-plain-2', 'key' => env('SQS_KEY_2', 'key'), 'secret' => env('SQS_SECRET_2', 'secret'), 'prefix' => env('SQS_PREFIX_2', 'prefix'), 'queue' => env('SQS_URL_2', 'queue'), 'region' => env('SQS_REGION_2', 'region'), ] ]

what did I do to use multiple connections? whether I must do any configuration something for this?

Any suggestions would be helpful.

@pmayet
Copy link

pmayet commented Mar 10, 2020

Can you explain your use case ? Why different drivers ?

@sshodges
Copy link

sshodges commented Jun 4, 2020

I am using PHP >=5.6.4 & Lumen 5.5.* & laravel-plain-sqs ^0.1.16

in config/queue.php

'connections' => [ 'sqs-plain' => [ 'driver' => 'sqs-plain', 'key' => env('SQS_KEY', 'key'), 'secret' => env('SQS_SECRET', 'secret'), 'prefix' => env('SQS_PREFIX', 'prefix'), 'queue' => env('SQS_URL', 'queue'), 'region' => env('SQS_REGION', 'region'), ], 'sqs-plain-2' => [ 'driver' => 'sqs-plain-2', 'key' => env('SQS_KEY_2', 'key'), 'secret' => env('SQS_SECRET_2', 'secret'), 'prefix' => env('SQS_PREFIX_2', 'prefix'), 'queue' => env('SQS_URL_2', 'queue'), 'region' => env('SQS_REGION_2', 'region'), ] ]

what did I do to use multiple connections? whether I must do any configuration something for this?

Any suggestions would be helpful.

did you find an answer to this?

@pixnbit
Copy link

pixnbit commented Mar 14, 2021

You could just use different queues with a same driver.

        $object = [
            'music' => 'M.I.A. - Bad girls',
            'time' => time()
        ];
        $job = new DispatcherJob($object);

        dispatch($job->setPlain())->onConnection('sqs-plain')->onQueue('LaravelTestQueue2');

The name of the queue matches the one you created on AWS. The name of the driver can also be specified other than the default one. But for your use case, you don't need a different driver.

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

No branches or pull requests

4 participants