|
@@ -0,0 +1,37 @@
|
|
|
|
+<?php
|
|
|
|
+
|
|
|
|
+declare(strict_types=1);
|
|
|
|
+use function Hyperf\Support\env;
|
|
|
|
+return [
|
|
|
|
+ 'enable' => true,
|
|
|
|
+ 'default' => [
|
|
|
|
+ 'host' => env('AMQP_HOST', '192.168.1.201'),
|
|
|
|
+ 'port' => (int)env('AMQP_PORT', 5672),
|
|
|
|
+ 'user' => env('AMQP_USER', 'admin'),
|
|
|
|
+ 'password' => env('AMQP_PASSWORD', '123456'),
|
|
|
|
+ 'vhost' => '/',
|
|
|
|
+ 'concurrent' => [
|
|
|
|
+ 'limit' => 1,
|
|
|
|
+ ],
|
|
|
|
+ 'pool' => [
|
|
|
|
+ 'connections' => 1,
|
|
|
|
+ ],
|
|
|
|
+ 'params' => [
|
|
|
|
+ 'insist' => false,
|
|
|
|
+ 'login_method' => 'AMQPLAIN',
|
|
|
|
+ 'login_response' => null,
|
|
|
|
+ 'locale' => 'en_US',
|
|
|
|
+ 'connection_timeout' => 300.0,
|
|
|
|
+ // 尽量保持是 heartbeat 数值的两倍
|
|
|
|
+ 'read_write_timeout' => 600.0,
|
|
|
|
+ 'context' => null,
|
|
|
|
+ 'keepalive' => false,
|
|
|
|
+ // 尽量保证每个消息的消费时间小于心跳时间
|
|
|
|
+ 'heartbeat' => 3,
|
|
|
|
+ 'close_on_destruct' => false,
|
|
|
|
+ ],
|
|
|
|
+ ],
|
|
|
|
+ 'pool2' => [
|
|
|
|
+
|
|
|
|
+ ]
|
|
|
|
+];
|