Using queues with Laravel Vapor.
queues
option in your environment’s vapor.yml
configuration. The first queue in the list of queues will be considered your “default” queue and will automatically be set as the SQS_QUEUE
environment variable:
-staging
and -production
to the queue names specified in your application’s vapor.yml
file:
sqs
queue configuration includes a suffix
option that references the SQS_SUFFIX
environment variable by default. When this option and variable are defined, you may provide the queue name without its suffix when dispatching jobs and Laravel will automatically append the suffix to the queue name when interacting with SQS:
queues
option to false
:
queue-concurrency
option in the environment’s vapor.yml
configuration:
queue-concurrency
option defines the total maximum concurrency of all queues. For example, if you were to define two custom queues and a queue-concurrency
of 100 the total maximum concurrency will still be 100.
cli-concurrency
option if no value was set for queue-concurrency
. Before you set a limit on cli-concurrency
, make sure you provide a value for queue-concurrency
that’s suitable specifically for your queue processing requirements.emails
and invoices
queue is 10, meaning if the queue Lambda function is processing ten jobs concurrently, it will not pick up any more jobs from the queue until jobs are finished and capacity becomes available. This behavior differs from when the total invocations reach the queue function’s overall capacity, where throttling occurs instead.
You may also set the maximum concurrency on some queues but not others. In the example below, the emails
queue is not allowed more than ten concurrent invocations, whereas it’s possible to invoke the invoices
queue until the overall capacity is reached:
queue-concurrency
option or the general AWS account concurrency limit. In addition, the concurrency value must be an integer between 2 and 1,000.queue-timeout
option in the environment’s vapor.yml
configuration. For example, we may set this timeout to five minutes:
queue-memory
option in your environment’s vapor.yml
configuration to define the memory that should be available to your queue worker Lambda function:
queue-database-session-persist
option in your environment’s vapor.yml
configuration file to instruct Vapor to reuse the same database connection across jobs:
--force
flag.