queue.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <?php
  2. return [
  3. /*
  4. |--------------------------------------------------------------------------
  5. | Default Queue Connection Name
  6. |--------------------------------------------------------------------------
  7. |
  8. | Laravel's queue supports a variety of backends via a single, unified
  9. | API, giving you convenient access to each backend using identical
  10. | syntax for each. The default queue connection is defined below.
  11. |
  12. */
  13. 'default' => env('QUEUE_CONNECTION', 'database'),
  14. /*
  15. |--------------------------------------------------------------------------
  16. | Queue Connections
  17. |--------------------------------------------------------------------------
  18. |
  19. | Here you may configure the connection options for every queue backend
  20. | used by your application. An example configuration is provided for
  21. | each backend supported by Laravel. You're also free to add more.
  22. |
  23. | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
  24. |
  25. */
  26. 'connections' => [
  27. 'sync' => [
  28. 'driver' => 'sync',
  29. ],
  30. 'database' => [
  31. 'driver' => 'database',
  32. 'connection' => env('DB_QUEUE_CONNECTION'),
  33. 'table' => env('DB_QUEUE_TABLE', 'jobs'),
  34. 'queue' => env('DB_QUEUE', 'default'),
  35. 'retry_after' => (int) env('DB_QUEUE_RETRY_AFTER', 90),
  36. 'after_commit' => false,
  37. ],
  38. 'beanstalkd' => [
  39. 'driver' => 'beanstalkd',
  40. 'host' => env('BEANSTALKD_QUEUE_HOST', 'localhost'),
  41. 'queue' => env('BEANSTALKD_QUEUE', 'default'),
  42. 'retry_after' => (int) env('BEANSTALKD_QUEUE_RETRY_AFTER', 90),
  43. 'block_for' => 0,
  44. 'after_commit' => false,
  45. ],
  46. 'sqs' => [
  47. 'driver' => 'sqs',
  48. 'key' => env('AWS_ACCESS_KEY_ID'),
  49. 'secret' => env('AWS_SECRET_ACCESS_KEY'),
  50. 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
  51. 'queue' => env('SQS_QUEUE', 'default'),
  52. 'suffix' => env('SQS_SUFFIX'),
  53. 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
  54. 'after_commit' => false,
  55. ],
  56. 'redis' => [
  57. 'driver' => 'redis',
  58. 'connection' => env('REDIS_QUEUE_CONNECTION', 'default'),
  59. 'queue' => env('REDIS_QUEUE', 'default'),
  60. 'retry_after' => (int) env('REDIS_QUEUE_RETRY_AFTER', 90),
  61. 'block_for' => null,
  62. 'after_commit' => false,
  63. ],
  64. 'rabbitmq' => [
  65. 'host' => env('RABBITMQ_HOST', '127.0.0.1'),
  66. 'port' => env('RABBITMQ_PORT', 5672),
  67. 'user' => env('RABBITMQ_USER', 'guest'),
  68. 'password' => env('RABBITMQ_PASSWORD', 'guest'),
  69. 'virtual_host' => env('RABBITMQ_VIRTUAL_HOST', '/'),
  70. 'heartbeat' => env('RABBITMQ_HEARTBEAT', 60), // 心跳时间(秒)
  71. ],
  72. ],
  73. /*
  74. |--------------------------------------------------------------------------
  75. | Job Batching
  76. |--------------------------------------------------------------------------
  77. |
  78. | The following options configure the database and table that store job
  79. | batching information. These options can be updated to any database
  80. | connection and table which has been defined by your application.
  81. |
  82. */
  83. 'batching' => [
  84. 'database' => env('DB_CONNECTION', 'sqlite'),
  85. 'table' => 'job_batches',
  86. ],
  87. /*
  88. |--------------------------------------------------------------------------
  89. | Failed Queue Jobs
  90. |--------------------------------------------------------------------------
  91. |
  92. | These options configure the behavior of failed queue job logging so you
  93. | can control how and where failed jobs are stored. Laravel ships with
  94. | support for storing failed jobs in a simple file or in a database.
  95. |
  96. | Supported drivers: "database-uuids", "dynamodb", "file", "null"
  97. |
  98. */
  99. 'failed' => [
  100. 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
  101. 'database' => env('DB_CONNECTION', 'sqlite'),
  102. 'table' => 'failed_jobs',
  103. ],
  104. ];