services.php 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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. 'settings' => [
  79. 'open_length_check' => true,
  80. 'package_max_length' => 15 * 1024 * 1024, // 最大包长度
  81. 'package_length_type' => 'N',
  82. 'package_body_offset' => 8,
  83. 'package_length_offset' => 4,
  84. 'package_length_field' => 'length',
  85. ],
  86. 'options' => [
  87. 'connect_timeout' => 50.0, // 连接超时时间,单位为秒
  88. 'read_timeout' => 100.0, // 读取超时时间,单位为秒
  89. 'write_timeout' => 100.0, // 写入超时时间,单位为秒
  90. ],
  91. 'pool' => [
  92. 'min_connections' => 1,
  93. 'max_connections' => 30,
  94. 'connect_timeout' => 100.0, // 连接池连接超时时间,单位为秒
  95. 'wait_timeout' => 30.0, // 等待连接池可用连接的超时时间,单位为秒
  96. 'heartbeat' => -1, // 心跳检测间隔,-1 表示禁用心跳检测
  97. 'max_idle_time' => 60.0, // 连接的最大空闲时间,单位为秒
  98. ],
  99. ],
  100. [
  101. //友情链接服务
  102. 'name' => 'LinkService',
  103. 'service' => \App\JsonRpc\LinkServiceInterface::class,
  104. // 直接对指定的节点进行消费,通过下面的 nodes 参数来配置服务提供者的节点信息
  105. 'nodes' => [
  106. ['host' => '127.0.0.1', 'port' => 9502],
  107. ],
  108. ],
  109. [
  110. //商圈服务
  111. 'name' => 'ChatService',
  112. 'service' => \App\JsonRpc\ChatServiceInterface::class,
  113. // 直接对指定的节点进行消费,通过下面的 nodes 参数来配置服务提供者的节点信息
  114. 'nodes' => [
  115. ['host' => '127.0.0.1', 'port' => 9507],
  116. ],
  117. ],
  118. [
  119. //广告订单服务
  120. 'name' => 'OrderService',
  121. 'service' => \App\JsonRpc\OrderServiceInterface::class,
  122. // 直接对指定的节点进行消费,通过下面的 nodes 参数来配置服务提供者的节点信息
  123. 'nodes' => [
  124. ['host' => '127.0.0.1', 'port' => 9508],
  125. ],
  126. ],
  127. [
  128. //采集器服务
  129. 'name' => 'CollectorService',
  130. 'service' => \App\JsonRpc\CollectorServiceInterface::class,
  131. // 直接对指定的节点进行消费,通过下面的 nodes 参数来配置服务提供者的节点信息
  132. 'nodes' => [
  133. ['host' => '127.0.0.1', 'port' => 9509],
  134. ],
  135. ],
  136. [
  137. //底部导航服务
  138. 'name' => 'FooterService',
  139. 'service' => \App\JsonRpc\FooterServiceInterface::class,
  140. // 直接对指定的节点进行消费,通过下面的 nodes 参数来配置服务提供者的节点信息
  141. 'nodes' => [
  142. ['host' => '127.0.0.1', 'port' => 9502],
  143. ],
  144. ],
  145. [
  146. //客户端服务
  147. 'name' => 'ClientService',
  148. 'service' => \App\JsonRpc\ClientServiceInterface::class,
  149. // 直接对指定的节点进行消费,通过下面的 nodes 参数来配置服务提供者的节点信息
  150. 'nodes' => [
  151. ['host' => '127.0.0.1', 'port' => 9510],
  152. ],
  153. ],
  154. ],
  155. ];