You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

117 lines
4.2 KiB

3 years ago
  1. <?php
  2. use PhpAmqpLib\Message\AMQPMessage;
  3. use PhpAmqpLib\Connection\AMQPLazySSLConnection;
  4. return [
  5. /**
  6. * Default connection
  7. */
  8. 'default' => env('AMQP_CONNECTION', 'rabbitmq'),
  9. /**
  10. * Available connections
  11. */
  12. 'connections' => [
  13. 'rabbitmq' => [
  14. 'connection' => [
  15. /**
  16. * Lazy connection does not support more than 1 host
  17. * Change connection **class** if you want to try more than one host
  18. */
  19. 'class' => AMQPLazySSLConnection::class,
  20. 'hosts' => [
  21. [
  22. 'host' => env('AMQP_HOST', 'localhost'),
  23. 'port' => env('AMQP_PORT', 5672),
  24. 'user' => env('AMQP_USER', ''),
  25. 'password' => env('AMQP_PASSWORD', ''),
  26. 'vhost' => env('AMQP_VHOST', '/'),
  27. ],
  28. ],
  29. /**
  30. * Pass additional options that are required for the AMQP*Connection class
  31. * You can check *Connection::try_create_connection method to check
  32. * if you want to pass additional data
  33. */
  34. 'options' => [],
  35. ],
  36. 'message' => [
  37. 'content_type' => env('AMQP_MESSAGE_CONTENT_TYPE', 'text/plain'),
  38. 'delivery_mode' => env('AMQP_MESSAGE_DELIVERY_MODE', AMQPMessage::DELIVERY_MODE_PERSISTENT),
  39. 'content_encoding' => env('AMQP_MESSAGE_CONTENT_ENCODING', 'utf-8'),
  40. ],
  41. 'exchange' => [
  42. 'name' => env('AMQP_EXCHANGE_NAME', 'amq.direct'),
  43. 'declare' => env('AMQP_EXCHANGE_DECLARE', false),
  44. 'type' => env('AMQP_EXCHANGE_TYPE', 'direct'),
  45. 'passive' => env('AMQP_EXCHANGE_PASSIVE', false),
  46. 'durable' => env('AMQP_EXCHANGE_DURABLE', true),
  47. 'auto_delete' => env('AMQP_EXCHANGE_AUTO_DELETE', false),
  48. 'internal' => env('AMQP_EXCHANGE_INTERNAL', false),
  49. 'no_wait' => env('AMQP_EXCHANGE_NOWAIT', false),
  50. 'arguments' => [],
  51. 'ticket' => env('AMQP_EXCHANGE_TICKET'),
  52. ],
  53. 'queue' => [
  54. 'name' => env('AMQP_QUEUE_NAME', 'amqp.laravel.queue'),
  55. 'declare' => env('AMQP_QUEUE_DECLARE', true),
  56. 'passive' => env('AMQP_QUEUE_PASSIVE', false),
  57. 'durable' => env('AMQP_QUEUE_DURABLE', true),
  58. 'exclusive' => env('AMQP_QUEUE_EXCLUSIVE', false),
  59. 'auto_delete' => env('AMQP_QUEUE_AUTO_DELETE', false),
  60. 'no_wait' => env('AMQP_QUEUE_NOWAIT', false),
  61. 'arguments' => [],
  62. 'ticket' => env('AMQP_QUEUE_TICKET'),
  63. ],
  64. 'consumer' => [
  65. 'tag' => env('AMQP_CONSUMER_TAG', ''),
  66. 'no_local' => env('AMQP_CONSUMER_NO_LOCAL', false),
  67. 'no_ack' => env('AMQP_CONSUMER_NO_ACK', false),
  68. 'exclusive' => env('AMQP_CONSUMER_EXCLUSIVE', false),
  69. 'no_wait' => env('AMQP_CONSUMER_NOWAIT', false),
  70. 'arguments' => [],
  71. 'ticket' => env('AMQP_CONSUMER_TICKET'),
  72. ],
  73. 'qos' => [
  74. 'enabled' => env('AMQP_QOS_ENABLED', false),
  75. 'prefetch_size' => env('AMQP_QOS_PREFETCH_SIZE', 0),
  76. 'prefetch_count' => env('AMQP_QOS_PREFETCH_COUNT', 1),
  77. 'global' => env('AMQP_QOS_GLOBAL', false),
  78. ],
  79. /**
  80. * Default Publish options
  81. */
  82. 'publish' => [
  83. 'mandatory' => false,
  84. 'immediate' => false,
  85. 'ticket' => null,
  86. 'batch_count' => 500,
  87. ],
  88. /**
  89. * Default Bind Options
  90. */
  91. 'bind' => [
  92. 'no_wait' => false,
  93. 'arguments' => [],
  94. 'ticket' => null,
  95. ],
  96. /**
  97. * Default Consume Options
  98. */
  99. 'consume' => [
  100. 'allowed_methods' => null,
  101. 'non_blocking' => false,
  102. 'timeout' => 0,
  103. ],
  104. ],
  105. ],
  106. ];