services.php 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <?php
  2. return [
  3. 'consumers' => [
  4. [
  5. // 用戶中心
  6. 'name' => 'UserService',
  7. 'service' => \App\JsonRpc\UserServiceInterface::class,
  8. // 直接对指定的节点进行消费,通过下面的 nodes 参数来配置服务提供者的节点信息
  9. 'nodes' => [
  10. ['host' => '127.0.0.1', 'port' => 9504],
  11. ],
  12. ],
  13. [
  14. // 权限管理
  15. 'name' => 'AuthorityService',
  16. 'service' => \App\JsonRpc\AuthorityServiceInterface::class,
  17. // 直接对指定的节点进行消费,通过下面的 nodes 参数来配置服务提供者的节点信息
  18. 'nodes' => [
  19. ['host' => '127.0.0.1', 'port' => 9504],
  20. ],
  21. ],
  22. [
  23. // 广告中心
  24. 'name' => 'AdService',
  25. 'service' => \App\JsonRpc\AdServiceInterface::class,
  26. // 直接对指定的节点进行消费,通过下面的 nodes 参数来配置服务提供者的节点信息
  27. 'nodes' => [
  28. ['host' => '127.0.0.1', 'port' => 9503],
  29. ],
  30. ],
  31. [
  32. //网站管理
  33. 'name' => 'WebsiteService',
  34. 'service' => \App\JsonRpc\WebsiteServiceInterface::class,
  35. // 直接对指定的节点进行消费,通过下面的 nodes 参数来配置服务提供者的节点信息
  36. 'nodes' => [
  37. ['host' => '127.0.0.1', 'port' => 9502],
  38. ],
  39. ],
  40. [
  41. //公共方法
  42. 'name' => 'PublicRpcService',
  43. 'service' => \App\JsonRpc\PublicRpcServiceInterface::class,
  44. // 直接对指定的节点进行消费,通过下面的 nodes 参数来配置服务提供者的节点信息
  45. 'nodes' => [
  46. ['host' => '127.0.0.1', 'port' => 9502],
  47. ],
  48. 'settings' => [
  49. 'open_length_check' => true,
  50. 'package_max_length' => 15 * 1024 * 1024, // 最大包长度
  51. 'package_length_type' => 'N',
  52. 'package_body_offset' => 8,
  53. 'package_length_offset' => 4,
  54. 'package_length_field' => 'length',
  55. ],
  56. 'options' => [
  57. 'connect_timeout' => 50.0, // 连接超时时间,单位为秒
  58. 'read_timeout' => 100.0, // 读取超时时间,单位为秒
  59. 'write_timeout' => 100.0, // 写入超时时间,单位为秒
  60. ],
  61. 'pool' => [
  62. 'min_connections' => 1,
  63. 'max_connections' => 30,
  64. 'connect_timeout' => 100.0, // 连接池连接超时时间,单位为秒
  65. 'wait_timeout' => 30.0, // 等待连接池可用连接的超时时间,单位为秒
  66. 'heartbeat' => -1, // 心跳检测间隔,-1 表示禁用心跳检测
  67. 'max_idle_time' => 60.0, // 连接的最大空闲时间,单位为秒
  68. ],
  69. ],
  70. [
  71. //资讯-新闻
  72. 'name' => 'NewsService',
  73. 'service' => \App\JsonRpc\NewsServiceInterface::class,
  74. // 直接对指定的节点进行消费,通过下面的 nodes 参数来配置服务提供者的节点信息
  75. 'nodes' => [
  76. ['host' => '127.0.0.1', 'port' => 9505],
  77. ],
  78. ],
  79. [
  80. //友情链接服务
  81. 'name' => 'LinkService',
  82. 'service' => \App\JsonRpc\LinkServiceInterface::class,
  83. // 直接对指定的节点进行消费,通过下面的 nodes 参数来配置服务提供者的节点信息
  84. 'nodes' => [
  85. ['host' => '127.0.0.1', 'port' => 9502],
  86. ],
  87. ],
  88. [
  89. //商圈服务
  90. 'name' => 'ChatService',
  91. 'service' => \App\JsonRpc\ChatServiceInterface::class,
  92. // 直接对指定的节点进行消费,通过下面的 nodes 参数来配置服务提供者的节点信息
  93. 'nodes' => [
  94. ['host' => '127.0.0.1', 'port' => 9507],
  95. ],
  96. ],
  97. [
  98. //广告订单服务
  99. 'name' => 'OrderService',
  100. 'service' => \App\JsonRpc\OrderServiceInterface::class,
  101. // 直接对指定的节点进行消费,通过下面的 nodes 参数来配置服务提供者的节点信息
  102. 'nodes' => [
  103. ['host' => '127.0.0.1', 'port' => 9508],
  104. ],
  105. ],
  106. [
  107. //采集器服务
  108. 'name' => 'CollectorService',
  109. 'service' => \App\JsonRpc\CollectorServiceInterface::class,
  110. // 直接对指定的节点进行消费,通过下面的 nodes 参数来配置服务提供者的节点信息
  111. 'nodes' => [
  112. ['host' => '127.0.0.1', 'port' => 9509],
  113. ],
  114. ],
  115. [
  116. //底部导航服务
  117. 'name' => 'FooterService',
  118. 'service' => \App\JsonRpc\FooterServiceInterface::class,
  119. // 直接对指定的节点进行消费,通过下面的 nodes 参数来配置服务提供者的节点信息
  120. 'nodes' => [
  121. ['host' => '127.0.0.1', 'port' => 9502],
  122. ],
  123. ],
  124. ],
  125. ];