123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- declare (strict_types = 1);
- use function Hyperf\Support\env;
- return [
- 'enable' => true,
- 'default' => [
- 'host' => env('AMQP_HOST', '192.168.1.127'),
- 'port' => (int) env('AMQP_PORT', 5672),
- 'user' => env('AMQP_USER', 'guest'),
- 'password' => env('AMQP_PASSWORD', 'guest'),
- 'vhost' => '/',
- 'concurrent' => [
- 'limit' => 1,
- ],
- 'pool' => [
- 'min_connections' => 1,
- 'max_connections' => 1, // 限制最大连接数为1
- 'connect_timeout' => 10.0,
- 'wait_timeout' => 3.0,
- 'heartbeat' => -1,
-
- ],
- 'params' => [
- 'insist' => false,
- 'login_method' => 'AMQPLAIN',
- 'login_response' => null,
- 'locale' => 'en_US',
- 'connection_timeout' => 3.0,
- // 尽量保持是 heartbeat 数值的两倍
- 'read_write_timeout' => 6.0,
- 'context' => null,
- 'keepalive' => false,
- // 尽量保证每个消息的消费时间小于心跳时间
- 'heartbeat' => 3,
- 'close_on_destruct' => false,
- ],
- ],
- 'pool2' => [
- ],
- ];
|