2
0

queue.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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",
  24. | "deferred", "background", "failover", "null"
  25. |
  26. */
  27. 'connections' => [
  28. 'sync' => [
  29. 'driver' => 'sync',
  30. ],
  31. 'database' => [
  32. 'driver' => 'database',
  33. 'connection' => env('DB_QUEUE_CONNECTION'),
  34. 'table' => env('DB_QUEUE_TABLE', 'jobs'),
  35. 'queue' => env('DB_QUEUE', 'default'),
  36. 'retry_after' => (int) env('DB_QUEUE_RETRY_AFTER', 90),
  37. 'after_commit' => false,
  38. ],
  39. 'beanstalkd' => [
  40. 'driver' => 'beanstalkd',
  41. 'host' => env('BEANSTALKD_QUEUE_HOST', 'localhost'),
  42. 'queue' => env('BEANSTALKD_QUEUE', 'default'),
  43. 'retry_after' => (int) env('BEANSTALKD_QUEUE_RETRY_AFTER', 90),
  44. 'block_for' => 0,
  45. 'after_commit' => false,
  46. ],
  47. 'sqs' => [
  48. 'driver' => 'sqs',
  49. 'key' => env('AWS_ACCESS_KEY_ID'),
  50. 'secret' => env('AWS_SECRET_ACCESS_KEY'),
  51. 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
  52. 'queue' => env('SQS_QUEUE', 'default'),
  53. 'suffix' => env('SQS_SUFFIX'),
  54. 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
  55. 'after_commit' => false,
  56. ],
  57. 'redis' => [
  58. 'driver' => 'redis',
  59. 'connection' => env('REDIS_QUEUE_CONNECTION', 'default'),
  60. 'queue' => env('REDIS_QUEUE', 'default'),
  61. 'retry_after' => (int) env('REDIS_QUEUE_RETRY_AFTER', 90),
  62. 'block_for' => null,
  63. 'after_commit' => false,
  64. ],
  65. 'deferred' => [
  66. 'driver' => 'deferred',
  67. ],
  68. 'background' => [
  69. 'driver' => 'background',
  70. ],
  71. 'failover' => [
  72. 'driver' => 'failover',
  73. 'connections' => [
  74. 'database',
  75. 'deferred',
  76. ],
  77. ],
  78. 'rabbitmq' => [
  79. 'host' => env('RABBITMQ_HOST', '127.0.0.1'),
  80. 'port' => env('RABBITMQ_PORT', 5672),
  81. 'user' => env('RABBITMQ_USER', 'guest'),
  82. 'password' => env('RABBITMQ_PASSWORD', 'guest'),
  83. 'virtual_host' => env('RABBITMQ_VIRTUAL_HOST', '/'),
  84. 'heartbeat' => env('RABBITMQ_HEARTBEAT', 60), // 心跳时间(秒)
  85. ],
  86. ],
  87. /*
  88. |--------------------------------------------------------------------------
  89. | Job Batching
  90. |--------------------------------------------------------------------------
  91. |
  92. | The following options configure the database and table that store job
  93. | batching information. These options can be updated to any database
  94. | connection and table which has been defined by your application.
  95. |
  96. */
  97. 'batching' => [
  98. 'database' => env('DB_CONNECTION', 'sqlite'),
  99. 'table' => 'job_batches',
  100. ],
  101. /*
  102. |--------------------------------------------------------------------------
  103. | Failed Queue Jobs
  104. |--------------------------------------------------------------------------
  105. |
  106. | These options configure the behavior of failed queue job logging so you
  107. | can control how and where failed jobs are stored. Laravel ships with
  108. | support for storing failed jobs in a simple file or in a database.
  109. |
  110. | Supported drivers: "database-uuids", "dynamodb", "file", "null"
  111. |
  112. */
  113. 'failed' => [
  114. 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
  115. 'database' => env('DB_CONNECTION', 'sqlite'),
  116. 'table' => 'failed_jobs',
  117. ],
  118. ];