queue.php 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?php
  2. /*
  3. * This file is part of the Jiannei/lumen-api-starter.
  4. *
  5. * (c) Jiannei <longjian.huang@foxmail.com>
  6. *
  7. * This source file is subject to the MIT license that is bundled
  8. * with this source code in the file LICENSE.
  9. */
  10. return [
  11. /*
  12. |--------------------------------------------------------------------------
  13. | Default Queue Connection Name
  14. |--------------------------------------------------------------------------
  15. |
  16. | Lumen's queue API supports an assortment of back-ends via a single
  17. | API, giving you convenient access to each back-end using the same
  18. | syntax for every one. Here you may define a default connection.
  19. |
  20. */
  21. 'default' => env('QUEUE_CONNECTION', 'sync'),
  22. /*
  23. |--------------------------------------------------------------------------
  24. | Queue Connections
  25. |--------------------------------------------------------------------------
  26. |
  27. | Here you may configure the connection information for each server that
  28. | is used by your application. A default configuration has been added
  29. | for each back-end shipped with Lumen. You are free to add more.
  30. |
  31. | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
  32. |
  33. */
  34. 'connections' => [
  35. 'sync' => [
  36. 'driver' => 'sync',
  37. ],
  38. 'database' => [
  39. 'driver' => 'database',
  40. 'table' => env('QUEUE_TABLE', 'jobs'),
  41. 'queue' => 'default',
  42. 'retry_after' => 90,
  43. ],
  44. 'beanstalkd' => [
  45. 'driver' => 'beanstalkd',
  46. 'host' => 'localhost',
  47. 'queue' => 'default',
  48. 'retry_after' => 90,
  49. ],
  50. 'sqs' => [
  51. 'driver' => 'sqs',
  52. 'key' => env('SQS_KEY', 'your-public-key'),
  53. 'secret' => env('SQS_SECRET', 'your-secret-key'),
  54. 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
  55. 'queue' => env('SQS_QUEUE', 'your-queue-name'),
  56. 'region' => env('SQS_REGION', 'us-east-1'),
  57. ],
  58. 'redis' => [
  59. 'driver' => 'redis',
  60. 'connection' => env('QUEUE_REDIS_CONNECTION', 'default'),
  61. 'queue' => 'default',
  62. 'retry_after' => 90,
  63. 'block_for' => null,
  64. ],
  65. ],
  66. /*
  67. |--------------------------------------------------------------------------
  68. | Failed Queue Jobs
  69. |--------------------------------------------------------------------------
  70. |
  71. | These options configure the behavior of failed queue job logging so you
  72. | can control which database and table are used to store the jobs that
  73. | have failed. You may change them to any database / table you wish.
  74. |
  75. */
  76. 'failed' => [
  77. 'database' => env('DB_CONNECTION', 'mysql'),
  78. 'table' => env('QUEUE_FAILED_TABLE', 'failed_jobs'),
  79. ],
  80. ];