queue.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <?php
  2. return [
  3. /*
  4. |--------------------------------------------------------------------------
  5. | Default Queue Driver
  6. |--------------------------------------------------------------------------
  7. |
  8. | The Laravel queue API supports a variety of back-ends via an unified
  9. | API, giving you convenient access to each back-end using the same
  10. | syntax for each one. Here you may set the default queue driver.
  11. |
  12. | Supported: "null", "sync", "database", "beanstalkd", "sqs", "redis"
  13. |
  14. */
  15. 'default' => env('QUEUE_DRIVER', 'sync'),
  16. /*
  17. |--------------------------------------------------------------------------
  18. | Queue Connections
  19. |--------------------------------------------------------------------------
  20. |
  21. | Here you may configure the connection information for each server that
  22. | is used by your application. A default configuration has been added
  23. | for each back-end shipped with Laravel. You are free to add more.
  24. |
  25. */
  26. 'connections' => [
  27. 'sync' => [
  28. 'driver' => 'sync',
  29. ],
  30. 'database' => [
  31. 'driver' => 'database',
  32. 'table' => 'jobs',
  33. 'queue' => 'default',
  34. 'expire' => 60,
  35. ],
  36. 'beanstalkd' => [
  37. 'driver' => 'beanstalkd',
  38. 'host' => 'localhost',
  39. 'queue' => 'default',
  40. 'ttr' => 60,
  41. ],
  42. 'sqs' => [
  43. 'driver' => 'sqs',
  44. 'key' => 'your-public-key',
  45. 'secret' => 'your-secret-key',
  46. 'prefix' => 'https://sqs.us-east-1.amazonaws.com/your-account-id',
  47. 'queue' => 'your-queue-name',
  48. 'region' => 'us-east-1',
  49. ],
  50. 'redis' => [
  51. 'driver' => 'redis',
  52. 'connection' => 'redis-queue',
  53. 'queue' => 'default',
  54. 'expire' => 60,
  55. ],
  56. 'redis_queue' => [
  57. 'driver' => 'redis',
  58. 'connection' => 'redis_queue_new',
  59. 'queue' => 'default',
  60. 'expire' => 60,
  61. ]
  62. ],
  63. /*
  64. |--------------------------------------------------------------------------
  65. | Failed Queue Jobs
  66. |--------------------------------------------------------------------------
  67. |
  68. | These options configure the behavior of failed queue job logging so you
  69. | can control which database and table are used to store the jobs that
  70. | have failed. You may change them to any database / table you wish.
  71. |
  72. */
  73. 'failed' => [
  74. 'database' => env('DB_CONNECTION', 'mysql'),
  75. 'table' => 'failed_jobs',
  76. ],
  77. 'rabbitmq' => [
  78. 'driver' => 'rabbitmq',
  79. 'host' => env('RABBITMQ_HOST', '127.0.0.1'),
  80. 'port' => env('RABBITMQ_PORT', 5672),
  81. 'vhost' => env('RABBITMQ_VHOST', '/'),
  82. 'login' => env('RABBITMQ_LOGIN', 'guest'),
  83. 'password' => env('RABBITMQ_PASSWORD', 'guest'),
  84. 'queue' => env('RABBITMQ_QUEUE'), // name of the default queue,
  85. 'exchange_declare' => env('RABBITMQ_EXCHANGE_DECLARE', true), // create the exchange if not exists
  86. 'queue_declare_bind' => env('RABBITMQ_QUEUE_DECLARE_BIND', true), // create the queue if not exists and bind to the exchange
  87. 'queue_params' => [
  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),
  92. ],
  93. 'exchange_params' => [
  94. 'name' => env('RABBITMQ_EXCHANGE_NAME', null),
  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),
  99. ],
  100. ],
  101. 'mns' => [
  102. 'driver' => 'mns',
  103. 'key' => env('QUEUE_MNS_ACCESS_KEY'),
  104. 'secret' => env('QUEUE_MNS_SECRET_KEY'),
  105. 'endpoint' => env('QUEUE_MNS_ENDPOINT'),
  106. 'queue' => env('QUEUE_NAME'),
  107. 'wait_seconds' => 30,
  108. ]
  109. ];