amqp.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. declare(strict_types=1);
  3. use function Hyperf\Support\env;
  4. return [
  5. 'enable' => true,
  6. 'default' => [
  7. 'host' => env('AMQP_HOST', '192.168.1.201'),
  8. 'port' => (int)env('AMQP_PORT', 5672),
  9. 'user' => env('AMQP_USER', 'admin'),
  10. 'password' => env('AMQP_PASSWORD', '123456'),
  11. 'vhost' => '/',
  12. 'concurrent' => [
  13. 'limit' => 1,
  14. ],
  15. 'pool' => [
  16. 'connections' => 1,
  17. ],
  18. 'params' => [
  19. 'insist' => false,
  20. 'login_method' => 'AMQPLAIN',
  21. 'login_response' => null,
  22. 'locale' => 'en_US',
  23. 'connection_timeout' => 3.0,
  24. // 尽量保持是 heartbeat 数值的两倍
  25. 'read_write_timeout' => 6.0,
  26. 'context' => null,
  27. 'keepalive' => false,
  28. // 尽量保证每个消息的消费时间小于心跳时间
  29. 'heartbeat' => 3,
  30. 'close_on_destruct' => false,
  31. ],
  32. ],
  33. 'pool2' => [
  34. ]
  35. ];