Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to set the default queue connection in Laravel's config.
Laravel
'default' => env('QUEUE_CONNECTION', '[1]'),
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'redis' or 'database' without configuring them first.
Leaving the default connection blank.
✗ Incorrect
The default queue connection is usually set to 'sync' for synchronous processing in Laravel.
2fill in blank
mediumComplete the code to specify the queue driver in the .env file.
Laravel
QUEUE_CONNECTION=[1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'sync' when asynchronous processing is needed.
Forgetting to install and configure Redis.
✗ Incorrect
Setting QUEUE_CONNECTION to 'redis' uses Redis as the queue backend.
3fill in blank
hardFix the error in the queue configuration array to set the Redis queue connection.
Laravel
'redis' => [ 'driver' => '[1]', 'connection' => 'default', ],
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Setting driver to 'database' or 'sync' by mistake.
Misspelling 'redis' in the driver key.
✗ Incorrect
The 'driver' key must be set to 'redis' to use Redis as the queue driver.
4fill in blank
hardFill both blanks to configure the database queue connection with the correct driver and table name.
Laravel
'database' => [ 'driver' => '[1]', 'table' => '[2]', 'queue' => 'default', 'retry_after' => 90, ],
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'redis' as driver for database connection.
Setting table name to 'failed_jobs' instead of 'jobs'.
✗ Incorrect
The database queue driver uses 'database' as driver and 'jobs' as the default table name.
5fill in blank
hardFill the blanks to configure the SQS queue connection with driver and queue URL.
Laravel
'sqs' => [ 'driver' => '[1]', 'key' => env('AWS_ACCESS_KEY_ID'), 'queue' => env('[2]'), 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), ],
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'redis' as driver for SQS.
Confusing environment variable names for queue URL.
✗ Incorrect
The SQS connection uses 'sqs' as driver and environment variable 'SQS_QUEUE_URL' for the queue URL.