|
1 | 1 | <?php |
2 | | -/** |
3 | | - * This is an example configuration of queue.php for RabbitMQ driver |
4 | | - * |
5 | | - * you can add as many connections as you want |
6 | | - */ |
7 | 2 |
|
8 | 3 | return [ |
9 | 4 |
|
10 | | - 'default' => 'rabbitmq', |
| 5 | + /* |
| 6 | + |-------------------------------------------------------------------------- |
| 7 | + | Default Queue Driver |
| 8 | + |-------------------------------------------------------------------------- |
| 9 | + | |
| 10 | + | The Laravel queue API supports a variety of back-ends via an unified |
| 11 | + | API, giving you convenient access to each back-end using the same |
| 12 | + | syntax for each one. Here you may set the default queue driver. |
| 13 | + | |
| 14 | + | Supported: "null", "sync", "database", "beanstalkd", |
| 15 | + | "sqs", "iron", "redis" |
| 16 | + | |
| 17 | + */ |
| 18 | + |
| 19 | + 'default' => env('QUEUE_DRIVER', 'sync'), |
| 20 | + |
| 21 | + /* |
| 22 | + |-------------------------------------------------------------------------- |
| 23 | + | Queue Connections |
| 24 | + |-------------------------------------------------------------------------- |
| 25 | + | |
| 26 | + | Here you may configure the connection information for each server that |
| 27 | + | is used by your application. A default configuration has been added |
| 28 | + | for each back-end shipped with Laravel. You are free to add more. |
| 29 | + | |
| 30 | + */ |
11 | 31 |
|
12 | 32 | 'connections' => [ |
13 | 33 |
|
| 34 | + 'sync' => [ |
| 35 | + 'driver' => 'sync', |
| 36 | + ], |
| 37 | + |
| 38 | + 'database' => [ |
| 39 | + 'driver' => 'database', |
| 40 | + 'table' => 'jobs', |
| 41 | + 'queue' => 'default', |
| 42 | + 'expire' => 60, |
| 43 | + ], |
| 44 | + |
| 45 | + 'beanstalkd' => [ |
| 46 | + 'driver' => 'beanstalkd', |
| 47 | + 'host' => 'localhost', |
| 48 | + 'queue' => 'default', |
| 49 | + 'ttr' => 60, |
| 50 | + ], |
| 51 | + |
| 52 | + 'sqs' => [ |
| 53 | + 'driver' => 'sqs', |
| 54 | + 'key' => 'your-public-key', |
| 55 | + 'secret' => 'your-secret-key', |
| 56 | + 'queue' => 'your-queue-url', |
| 57 | + 'region' => 'us-east-1', |
| 58 | + ], |
| 59 | + |
| 60 | + 'iron' => [ |
| 61 | + 'driver' => 'iron', |
| 62 | + 'host' => 'mq-aws-us-east-1.iron.io', |
| 63 | + 'token' => 'your-token', |
| 64 | + 'project' => 'your-project-id', |
| 65 | + 'queue' => 'your-queue-name', |
| 66 | + 'encrypt' => true, |
| 67 | + ], |
| 68 | + |
| 69 | + 'redis' => [ |
| 70 | + 'driver' => 'redis', |
| 71 | + 'queue' => 'default', |
| 72 | + 'expire' => 60, |
| 73 | + ], |
| 74 | + |
14 | 75 | 'rabbitmq' => [ |
15 | | - 'driver' => 'rabbitmq', |
| 76 | + 'driver' => 'rabbitmq', |
16 | 77 |
|
17 | | - 'host' => '', |
18 | | - 'port' => 5672, |
| 78 | + 'host' => env('RABBITMQ_HOST', '127.0.0.1'), |
| 79 | + 'port' => env('RABBITMQ_PORT', 5672), |
19 | 80 |
|
20 | | - 'vhost' => '/', |
21 | | - 'login' => '', |
22 | | - 'password' => '', |
| 81 | + 'vhost' => env('RABBITMQ_VHOST', '/'), |
| 82 | + 'login' => env('RABBITMQ_LOGIN', 'guest'), |
| 83 | + 'password' => env('RABBITMQ_PASSWORD', 'guest'), |
23 | 84 |
|
24 | | - 'queue' => '', // name of the default queue, |
| 85 | + 'queue' => env('RABBITMQ_QUEUE'), // name of the default queue, |
25 | 86 |
|
26 | 87 | 'queue_params' => [ |
27 | | - 'passive' => false, |
28 | | - 'durable' => true, |
29 | | - 'exclusive' => false, |
30 | | - 'auto_delete' => false, |
| 88 | + 'passive' => env('RABBITMQ_QUEUE_PASSIVE', false), |
| 89 | + 'durable' => env('RABBITMQ_QUEUE_DURABLE', true), |
| 90 | + 'exclusive' => env('RABBITMQ_QUEUE_EXCLUSIVE', false), |
| 91 | + 'auto_delete' => env('RABBITMQ_QUEUE_AUTODELETE', false), |
31 | 92 | ], |
32 | 93 |
|
33 | 94 | 'exchange_params' => [ |
34 | | - 'type' => 'direct', // more info at http://www.rabbitmq.com/tutorials/amqp-concepts.html |
35 | | - 'passive' => false, |
36 | | - 'durable' => true, // the exchange will survive server restarts |
37 | | - 'auto_delete' => false, // the exchange won't be deleted once the channel is closed. |
| 95 | + 'type' => env('RABBITMQ_EXCHANGE_TYPE', 'direct'), // more info at http://www.rabbitmq.com/tutorials/amqp-concepts.html |
| 96 | + 'passive' => env('RABBITMQ_EXCHANGE_PASSIVE', false), |
| 97 | + 'durable' => env('RABBITMQ_EXCHANGE_DURABLE', true), // the exchange will survive server restarts |
| 98 | + 'auto_delete' => env('RABBITMQ_EXCHANGE_AUTODELETE', false), |
38 | 99 | ], |
39 | 100 |
|
40 | 101 | ], |
41 | 102 |
|
42 | 103 | ], |
43 | 104 |
|
| 105 | + /* |
| 106 | + |-------------------------------------------------------------------------- |
| 107 | + | Failed Queue Jobs |
| 108 | + |-------------------------------------------------------------------------- |
| 109 | + | |
| 110 | + | These options configure the behavior of failed queue job logging so you |
| 111 | + | can control which database and table are used to store the jobs that |
| 112 | + | have failed. You may change them to any database / table you wish. |
| 113 | + | |
| 114 | + */ |
| 115 | + |
| 116 | + 'failed' => [ |
| 117 | + 'database' => 'mysql', 'table' => 'failed_jobs', |
| 118 | + ], |
| 119 | + |
44 | 120 | ]; |
0 commit comments